100 atcoder#ABC119B. [ABC119B] Digital Gifts
[ABC119B] Digital Gifts
Score : points
Problem Statement
Takahashi received otoshidama (New Year's money gifts) from of his relatives.
You are given values and strings as input. Each string is either JPY
or BTC
, and and represent the content of the otoshidama from the -th relative.
For example, if 10000
and JPY
, the otoshidama from the first relative is Japanese yen; if 0.10000000
and BTC
, the otoshidama from the second relative is bitcoins.
If we convert the bitcoins into yen at the rate of JPY per BTC, how much are the gifts worth in total?
Constraints
-
JPY
orBTC
. - If
JPY
, is an integer such that . - If
BTC
, is a decimal with decimal digits, such that .
Input
Input is given from Standard Input in the following format:
Output
If the gifts are worth yen in total, print the value (not necessarily an integer).
Output will be judged correct when the absolute or relative error from the judge's output is at most .
2
10000 JPY
0.10000000 BTC
48000.0
The otoshidama from the first relative is yen. The otoshidama from the second relative is bitcoins, which is worth yen if converted at the rate of JPY per BTC. The sum of these is yen.
Outputs such as 48000
and 48000.1
will also be judged correct.
3
100000000 JPY
100.00000000 BTC
0.00000001 BTC
138000000.0038
In this case, outputs such as 138001000
and 1.38e8
will also be judged correct.