Problem:
 Score : 200 points    Problem Statement Takahashi received otoshidama (New Year's money gifts) from N of his relatives.  You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC , and x_i and u_i represent the content of the otoshidama from the i -th relative.  For example, if x_1 =  10000 and u_1 =  JPY , the otoshidama from the first relative is 10000 Japanese yen; if x_2 =  0.10000000 and u_2 =  BTC , the otoshidama from the second relative is 0.1 bitcoins.  If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?      Constraints  2 \leq N \leq 10  u_i =  JPY or BTC .  If u_i =  JPY , x_i is an integer such that 1 \leq x_i \leq 10^8 .  If u_i =  BTC , x_i is a decimal with 8 decimal digits, such that 0.00000001 \leq x_i \leq 100.00000000 .         Input Input is given from Standard Input in the following format:  N  x_1  u_1  x_2  u_2  :  x_N  u_N       Output If the gifts are worth Y yen in total, print the value Y (not necessarily an integer).  Output will be judged correct when the absolute or relative error from the judge's output is at most 10^{-5} .        Sample Input 1 2
10000 JPY
0.10000000 BTC      Sample Output 1 48000.0  The otoshidama from the first relative is 10000 yen. The otoshidama from the second relative is 0.1 bitcoins, which is worth 38000.0 yen if converted at the rate of 380000.0 JPY per 1.0 BTC. The sum of these is 48000.0 yen.  Outputs such as 48000 and 48000.1 will also be judged correct.       Sample Input 2 3
100000000 JPY
100.00000000 BTC
0.00000001 BTC      Sample Output 2 138000000.0038  In this case, outputs such as 138001000 and 1.38e8 will also be judged correct.

Solution (Python):
N = int(input())

ans = 0.0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
        ans += x * 380000.0
    else:
        ans += x
print(ans)

Solution (Python):
N = int(input())
money = 0
for i in range(N):
    x, u = input().split()
    if u == 'JPY':
        money += float(x)
    else:
        money += float(x) * 380000.0
print("{}".format(money))

Solution (Python):
n=int(input())
l=[]
for i in range(n):
  a=input()
  if a[-3:]=='BTC':
    b=float(a[:-4])*380000.0
  else:
    b=float(a[:-4])
  l.append(b)
print(sum(l))

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
d = {'JPY':1, 'BTC':380000.0}
X = [None] * N
U = [None] * N

for i in range(N):
    X[i], U[i] = input().split()

print(sum(float(x) * d[u] for x, u in zip(X, U)))

Solution (Python):
N=(int)(input())
sum = 0
for i in range(0, N):
    x, u = input().split()
    if (u == "JPY"):
        sum = sum + (int)(x)
    elif (u == "BTC"):
        sum+=(float)(x) * 380000.0
  
print(sum)

Solution (Python):
N = int(input())

x = []
for i in range(N):
    x.append([j for j in input().split()])

ans = 0
for i in range(N):
    if x[i][1] == 'BTC':
        ans += 380000.0 * float(x[i][0])
    else:
        ans += float(x[i][0])

print(ans)

Solution (Python):
import numpy as np
n = int(input())
x = [0] * n
u = ['string'] * n
for j in range(n):
    x[j], u[j] = input().split()
for j in range(n):
    if u[j] == 'JPY':
        x[j] = int(x[j])
    elif u[j] == 'BTC':
        x[j] = float(x[j]) * 380000
print(np.sum(x))

Solution (Python):
if __name__ == '__main__':
    N = int(input())

    xu_list = [list(map(str, input().split())) for i in range(N)]

    answer = 0
    for xu in xu_list:
        if xu[1] == 'JPY':
            answer += int(xu[0])
        elif xu[1] == 'BTC':
            answer += float(xu[0]) * 380000.0

    print(answer)

Solution (Python):
N = int(input())
total=float(0)

for i in range(N):
  money = list(input().split())
  if money[1] == "JPY":
    total+=float(money[0])
  else:
    total+=(float(money[0])*380000)
print(total)

Solution (Python):
N = int(input())

yen = 0
bit = 0
for i in range(N):
    n = input().split()
    x = float(n[0])
    if n[1] == 'JPY':
        yen += x
    else:
        bit += x*380000

print(yen+bit)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    a,b = input().split()
    c = float(a)
    if b == 'JPY':
        ans += c
    else:
        ans += c*380000
print(ans)

Solution (Python):


def main():
    N = int(input())
    money = []
    for i in range(N):
        x, u = input().split()

        if u == 'BTC':
            x = float(x) * 380000
        money.append(float(x))

    moneysum = float(sum(money))
    print(moneysum)


if __name__ == "__main__":
    main()

Solution (Python):
def btc_to_jpy(btc):
    return btc * 380000


N = int(input())
sum = 0
for i in range(N):
    q, c = input().split()
    if c == 'JPY':
        q = int(q)
        sum += q
    else:
        q = float(q)
        sum += btc_to_jpy(q)
print(sum)

Solution (Python):
n=int(input())
l=list(list(input().split() for i in range(n)))
ans=0
for j in range(n):
   if l[j-1][1]=='JPY':
       ans+=float(l[j-1][0])
   else:
       ans+=float(l[j-1][0])*380000
print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
  x, u = input().split()
  if (u == 'JPY'):
    ans += float(x)
  else:
    ans += float(x) * 380000.0
print(ans)

Solution (Python):
n=int(input())

total=0
for i in range(n):
  a,b=map(str,input().split())

  if b == "JPY":
    total += int(a)
  else:
    total += float(a)*380000
print(total)

Solution (Python):
n = int(input())
yen = 0
for i in range(n):
	x,u = input().split()
	if u == 'JPY':
		yen += float(x)
	elif u == 'BTC':
		yen += float(x)*380000.0
print(yen)

Solution (Python):
btc = 380000.0

n = int(input())

ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        ans += x
    elif u == "BTC":
        ans += x * btc

print(ans)

Solution (Python):
N = int(input())
ans = 0
XUs = [input().split(" ") for i in range(N)]
for x, u in XUs:
    ans += int(x) if u=="JPY" else 380000*float(x)
print(ans)

Solution (Python):
import sys
input=sys.stdin.readline
N=int(input())
s=0
for i in range(N):
  u = input().split()
  if u[1] == "JPY":
    s+=float(u[0])
  else:
    s+=float(u[0])*380000.0
print(s)

Solution (Python):
a = int(input())
A=[]
for i in range(a):
  array = input().split(' ')
  A.append(array)

sum=0
for j in A:
  if j[1]=='JPY':
    sum += int(j[0])
  else:
    sum += float(j[0])*380000
print(sum)

Solution (Python):
N = int(input())
total_yen = 0
btc = 0
for i in range (N):
    x, u =map(str,input().split())
    if u == 'JPY':
        total_yen += float(x)
    else:
        btc       += float(x)

print(total_yen+380000.0*btc)

Solution (Python):
n = int(input())
x = [0] * n
u = [0] * n
for j in range(n):
  x[j], u[j] = input().split()
  x[j] = float(x[j])
ans = 0.0
for i in range(n):
  if u[i] == 'JPY':
    ans += x[i]
  else:
    ans += x[i] * 380000.0
print(ans)

Solution (Python):
n=int(input())
a=[input().split() for i in range(n)]
ans=0
for s in range(n):
 if a[s][1]=="JPY":
  ans=ans+float(a[s][0])
 else:
  ans=ans+float(a[s][0])*380000.0

print(ans)

Solution (Python):


n = int(input())

sum = 0
for i in range(n):
    x,u = map(str, input().split())
    x = float(x)
    if u == 'JPY':
        sum += x
    elif u == 'BTC':
        sum += x * 380000.0

print(sum)

Solution (Python):
n = int(input())
x = [0] * n
u = [0] * n

ans = 0
for i in range(n):
    x[i], u[i] = input().split()
    x[i] = float(x[i])

for i in range(n):
    if u[i] == "JPY":
        ans += x[i]
    else:
        ans += x[i]*380000

print(ans)

Solution (Python):
n=int(input())
X=[0]*n
u=[0]*n
for i in range(n):
  X[i],u[i]=input().split()
x=[float(i) for i in X]
ans=0
for i in range(n):
  if u[i]=='JPY':
    ans+=x[i]
  else:
    ans+=380000.0*x[i]
print(ans)

Solution (Python):
N=int(input())
sum=0
XU=[]

for i in range(N):
    XU=input().split()
    if XU[1]=='JPY':
        sum+=float(XU[0])
    else:
        sum+=float(XU[0])*380000.0
        
print(sum)

Solution (Python):
from decimal import Decimal
N = int(input())

target = [list(input().split()) for i in range(N)]

result = 0

for t in target:
    if t[1] == 'JPY':
        result += int(t[0])
    else:
        
        result += Decimal(t[0]) * Decimal(380000.0)
print(result)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    a, b = map(str, input().split())
    if b == 'JPY': 
        ans += float(a)
    else: 
        ans += float(a) * 380000.0

print (ans)

Solution (Python):
N = int(input())
yen = 0.0
for _ in range(N):
    tmp = input().split()
    if tmp[1] == "JPY":
        yen += float(tmp[0])
    else:
        yen += float(tmp[0]) * 380000.0
print(yen)

Solution (Python):
N = int(input())
money = 0
for i in range(N):
  x, u = input().split()
  if u == 'JPY':
    money += float(x)
  else:
    money += float(x) * 380000
print(money)

Solution (Python):
N = int(input())
x = [0]*N
u = [0]*N
ans = 0
for i in range(N):
  x[i], u[i] = input().split()
  x[i] = float(x[i])
  if u[i] == "BTC":
    x[i] = x[i]*380000.0

print(sum(x))

Solution (Python):


def solve():
    N = int(input())
    ans = 0
    for i in range(N):
        x, u = input().split()
        x = float(x)

        if u=="JPY":
            ans += x
        else:
            ans += x*380000
    print(ans)


if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
a = 0
for i in range(n):
    x, u = input().split()
    if u == 'JPY':u=1
    else:u = 380000
    a += float(x)*u
print(a)

Solution (Python):
N = int(input())

jpy = 0
bit = 0
rate = 380000
for i in range(N):
    m,c = input().split()
    if c == 'JPY':
        jpy = jpy + int(m)
    else:
        bit = bit + float(m)

print(jpy + bit * rate)

Solution (Python):
N = int(input())

ans = 0
for _ in range(N):
    x, u = input().split()
    x = float(x)
    if u == 'BTC':
        x *= 380000
    ans += x
print(ans)

Solution (Python):
inpl = lambda: list(map(int,input().split()))
N = int(input())
BTC = 380000
ans = 0
for i in range(N):
    x, u = input().split()
    if u == 'BTC':
        ans += BTC * float(x)
    else:
        ans += int(x)
print(ans)

Solution (Python):
n = int(input())
xulist = [input().split() for i in range(n)]

rate = 380000.0

total = 0.0
for xu in xulist:
    x = float(xu[0])
    u = xu[1]
    if u == 'BTC':
        x *= rate
    total += x

print(total)

Solution (Python):


def main():
    N = int(input())
    btc_to_jpy = 380000.0
    ans = 0
    for i in range(N):
        temp_value,unit = input().split()
        value = float(temp_value)
        if unit == "BTC":
            value *= btc_to_jpy
        ans += value
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a=[]
ans=0
for i in range(n):
    a.clear()
    a=input().split()
    a[0]=float(a[0])
    if a[1]=="JPY":
        ans+=a[0]
    else:
        ans+=a[0]*380000
print(ans)

Solution (Python):
import sys
_ = input()
price = 0
for line in sys.stdin:
  x,u = line.strip().split(' ')
  if u == 'JPY':
    price += float(x)
  else:
    price += float(x)*380000.0
print(price)

Solution (Python):

import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, x: "List[float]", u: "List[str]"):
    ret = 0
    for xx, uu in zip(x, u):
        ret += xx * {
            'JPY': 1.0,
            'BTC': 380000.0
        }[uu]
    return ret

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    x = [float()] * (N)  
    u = [str()] * (N)  
    for i in range(N):
        x[i] = float(next(tokens))
        u[i] = next(tokens)
    result = solve(N, x, u)
    print(result)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    u,x = input().split()
    if x == 'JPY':
        ans += int(u)
    else:
        ans += float(u)*380000
print(ans)

Solution (Python):
N = int(input())
d = {'JPY': 1.0, 'BTC': 380000.0}
num = 0
for i in range(N):
    x, u = input().split()
    num += float(x) * d[u]

print(num)

Solution (Python):
n=int(input())
sum=0.0
for i in range(n):
    x,u=input().split()
    if u=='JPY':
        sum+=int(x)
    else :
        sum+=float(x)*380000.0
print(sum)

Solution (Python):
n=int(input())
a=[]
sum=0
for i in range(n):
  a.append(list(input().split()))
  if a[i][1]=="BTC":
    sum+=float(a[i][0])*380000.0
  else:
    sum+=int(a[i][0])
print(sum)

Solution (Python):
n = int(input())
money = 0.0
for i in range(n):
  x,u = input().split()
  x = float(x)
  if u == 'JPY':
    money += x
  else:
    money += 380000.0 * x 
print('{:.11f}'.format(money))

Solution (Python):
n = int(input())
money = 0.0
for i in range(n):
  x,u = input().split()
  x = float(x)
  if u == 'JPY':
    money += x
  else:
    money += 380000.0 * x 
print(money)

Solution (Python):
s=0
for i in range(int(input())):
    a,b=input().split()
    a=float(a)
    if b=="BTC":
        a*=380000
    s+=a
print(s)

Solution (Python):
ans=0
N=int(input())
for i in range(N):
    x,u=input().split()
    if u=='JPY':
        ans+=int(x)
    else:
        ans+=float(x)*380000.0
print(ans)

Solution (Python):
n = int(input())
xy = []
ret = 0
for i in range(n):
    tmp = input().split()
    if tmp[1] == "JPY":
        ret += float(tmp[0])
    else:
        ret += float(tmp[0])*380000

print(ret)

Solution (Python):
n=int(input())
ans=0
for i in range(n):
    x,y=map(str,input().split())
    if y=='JPY':
        ans+=int(x)
    else:
        ans+=float(x)*380000
print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
  [x,u] = input().split()
  x = float(x)
  if u == "JPY":
    ans += int(x)
  else:
    ans += x*380000
print(ans)

Solution (Python):
n = int(input())
_sum = 0
for _ in range(n):
    x, u = [i for i in input().split()]
    x = float(x)
    if u == "JPY":
        _sum += x
    else:
        _sum += 380000 * x
print(_sum)

Solution (Python):
N = int(input())
res = 0
for i in range(N):
  x, y = input().split()
  if y == 'JPY':
    res += int(x)
  else:
    res += float(x) * 380000
    
print(res)

Solution (Python):
N = int(input())

a = 0
for _ in range(N):
  m = input().split()
  u = int(m[1].replace('JPY','1').replace('BTC','380000'))
  x = float(m[0])
  a += x * u
  
print(a)

Solution (Python):
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools


import random


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

N=int(input())
ans=0
for i in range(N):
    x,u=input().split()
    if u=="BTC":
        x=float(x)
        ans+=380000*x
    else:
        x=int(x)
        ans+=x
print(ans)

Solution (Python):
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Solution (Python):
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])

Solution (Python):
n = int(input())
ans = 0
BTC = 380000
for _ in range(n):
    x, u = input().split()
    if u == "BTC":
        ans += BTC * float(x)
    else:
        ans += int(x)
print(ans)

Solution (Python):
n = int(input())
ans = 0
BTC = 380000
for _ in range(n):
    x, u = input().split()
    if u == "BTC":
        ans += BTC * float(x)
    else:
        ans += int(x)
print(ans)

Solution (Python):
n = int(input())
summ= 0
for i in range(n):
    x,u = map(str,input().split())
    if u == "JPY":
        summ+=float(x)
    else:
        summ+=float(x)*380000.0

print(summ)

Solution (Python):
N = int (input())
T = 0
for i in range(N):
    X,Y = input().split()
    X = float(X) 
    if Y == 'JPY':
        z = X
    else:
        z = X * 380000
    T += z

print(T)

Solution (Python):
N = int(input())
x_list = []
u_list = []
sum = 0
for i in range(N):
    x, u = map(str, input().split())
    if u == "JPY":
        sum += float(x)
    else:
        sum += float(x) * 380000.0
print(float(sum))

Solution (Python):
N = int(input())
jpy = 0
btc = 0
for _ in range(N):
    x, u = input().split()
    if u == 'JPY':
        jpy += int(x)
    else:
        btc += float(x)
ans = jpy + btc * 380000.0
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    x,u = input().split()
    ans += float(x) if u == 'JPY' else float(x)*380000
print(ans)

Solution (Python):
N = int(input())


def bit2yen(x):
    return x * 380000

ans = 0

for i in range(N):
    x, y = input().split()
    if y == "JPY":
        ans += int(x)
    else:
        ans += bit2yen(float(x))

print(ans)

Solution (Python):
N = int(input())
y = [(input().split()) for i in range(N)]
Y = 0
for j in range(N):
    if y[j][1] == 'JPY':
        Y += int(y[j][0])
    else:
        Y += float(y[j][0]) * 380000
print(Y)

Solution (Python):
N = int(input())
XY = [input().split() for _ in range(N)]

XYvalue = map(lambda xy:[float(xy[0]), float(xy[0]) * 380000.0][not("JPY" == xy[1])], XY)

print(sum(XYvalue))

Solution (Python):
N = int(input())
yen = 0
btc = float(0)
for i in range(N):
    x,u = map(str, input().split())
    if u == "JPY":
        yen += int(x)
    else:
        btc += float(x)
print(float(yen) + btc*380000.0)

Solution (Python):
N = int(input())

s = 0
for _ in range(N):
    x, u = input().split(" ")
    if u == "JPY":
        s += float(x) 
    else:
        s += float(x) * 380000.0 

print(s)

Solution (Python):
N = int(input())

ans = 0
for i in range(N):
  num, t = map(str, input().split())
  num = float(num)
  if t == 'JPY':
    ans += num
  else:
    ans += num * 380000
print(ans)

Solution (Python):
n = int(input())
p = 0
for i in range(n):
  line = input().split()
  x = float(line[0])
  u = line[1]
  if u == 'JPY':
    p += x
  else:
    p += x * 380000

print(p)

Solution (Python):


RATE = 380000
n = int(input())
total = 0

for _ in range(n):
    x, u = input().rstrip().split()
    x = float(x)
    total += x if u == "JPY" else x * RATE

print(total)

Solution (Python):

n = int(input())
lst = [input().rstrip().split() for _ in range(n)]
total = 0

for i in range(n):
    if lst[i][1] == 'JPY':
        total += int(lst[i][0])
    else:
        total += 380000 * float(lst[i][0])
        
print(total)

Solution (Python):
N = int(input())
answer = 0
for _ in range(N):
  x, u = input().split()
  x = float(x)
  if u=='JPY':
    answer += x
  else:
    answer += x*380000
print(answer)

Solution (Python):
n = int(input())
amount = 0
for i in range(n):
  x,c = input().split()
  if c == 'JPY':
    amount += int(x)
  else :
    amount += float(x)* 380000
print(amount)

Solution (Python):


def main():
    N = int(input())
    total = .0
    for _ in range(N):
        x, u = input().split()
        total += float(x) if u == "JPY" else float(x) * 380000.0

    print(total)

if __name__ == '__main__':
    main()

Solution (Python):


ans = 0
N = int(input())
for _ in range(N):
    x, u = input().split()
    ans += float(x) * 380000 if u == 'BTC' else float(x)

print(ans)

Solution (Python):
N = int(input())

rate = 380000.0

otoshidama = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
        otoshidama += x * rate
    else:
        otoshidama += x
print(otoshidama)

Solution (Python):
N = int(input())
x = [0] * N
u = [0] * N
ans = 0

for i in range(N):
    x[i], u[i] = map(str, input().split())
    x[i] = float(x[i])

    if u[i] == 'BTC':
        ans += x[i] * 380000
    else:
        ans += x[i]

print(ans)

Solution (Python):
N = int(input())
xu = [input().split() for _ in range(N)]
total = 0.0
for x, u in xu:
    x = float(x)
    if u == "BTC":
        x *= 380000
    total += x
print(total)

Solution (Python):
by = {"JPY" : 1.0, "BTC" : 380000.0}

N = int(input())
lst = [input().split() for i in range(N)]
lst = [[float(lst[i][0]), lst[i][1] ] for i in range(N)]
s = sum([lst[i][0] * by[lst[i][1]] for i in range(N)])
print(s)

Solution (Python):
count = 0
N =int(input())
for _ in range(N):
    x, u =[_ for _ in input().split()]
    x= float(x)
    if u =='JPY':
        count += x
    else:
        count += x * 380000
print(count)

Solution (Python):
n=int(input())
total=0
for i in range(0,n):
    x,u=map(str,input().split())
    if u=='JPY':
        total=total+int(x)
    elif u=='BTC':
        total=total+float(x)*380000
print(total)

Solution (Python):
N = int(input())
ans = 0
for _ in range(N):
	x, u = input().split()
	if u == "JPY":
		ans += float(x)
	else:
		ans += float(x) * 380000.0
print(ans)

Solution (Python):
sum = 0
N =int(input())
for _ in range(N):
    x, v =[_ for _ in input().split()]
    x= float(x)
    if v =='JPY':
        sum += x
    else:
        sum += x * 380000
print(sum)

Solution (Python):
N = int(input())
x=[0]*N
u=[0]*N
ans = 0
rate = 380000.0
for i in range(N):
    x[i],u[i] = input().split()
    if u[i]=='JPY':
        x[i]= int(x[i])
        ans += x[i]
    elif u[i]=='BTC':
        x[i] = float(x[i])
        ans += x[i]*rate
    else:
        raise AssertionError
print(ans)

Solution (Python):
n=int(input())
x=[0]*n
y=[0]*n
for i in range(n):
    x[i],y[i]=input().split()
ans=0
for i in range(n):
    if y[i]=='JPY':
        ans+=float(x[i])
    else:
        ans+=float(x[i])*380000.0
print(ans)

Solution (Python):
N = int(input())
sum_money = 0

for i in range(N):
    x = input().split()
    if x[1]=='JPY':
        sum_money = sum_money + int(x[0])
    else :
        sum_money = sum_money + float(x[0])*380000
    x=[]

print(sum_money)

Solution (Python):
N = int(input())
yen = 0.0
goukei = 0.0
tuuka = ""
b2y = lambda y: y*380000
for i in range(N):
  yen, tuuka = input().split()
  if tuuka == "JPY":
    yen = int(yen)
    goukei += yen
  elif tuuka == "BTC":
    yen = float(yen)
    yen = b2y(yen)
    goukei += yen
print(goukei)

Solution (Python):
N = int(input())
rate = 380000.0
ans = 0.0
for i in range(N):
    x, u = input().split()
    x = float(x)
    ans += x * rate if u == 'BTC' else x
print('{:.11f}'.format(ans))

Solution (Python):
N = int(input())
money = [input().rstrip().split() for _ in range(N)]
total = 0
JPY = [int(money[i][0]) for i in range(N) if money[i][1] == 'JPY']
BTC = [float(money[i][0])*380000.0 for i in range(N) if money[i][1] == 'BTC']

print(sum(JPY)+sum(BTC))

Solution (Python):


ER = 380000.0

N = int(input())

total_yens = 0.0

for i in range(N):
    u_i, x_i = raw_input().split()
    if x_i == 'JPY':
        total_yens += int(u_i)
    else: 
        total_yens += (float(u_i) * ER)

print '{0:.4f}'.format(total_yens)

Solution (Python):
N = int(input())

xun = []
for _ in range(N):
	x,u = input().split()
	xun.append([x,u])
	
sumYen = 0
for xu in xun:
	if xu[1] == "BTC":
		sumYen += (float(xu[0])*380000)
	else:
		sumYen += int(xu[0])
		
print(sumYen)

Solution (Python):
N = int(input())
S = [list(map(str, input().split())) for i in range(N)]
Y = 0
for i in range(N):
    if(S[i][1] == 'BTC'):
        Y += float(S[i][0]) * 380000
    else:
        Y += float(S[i][0])
print(Y)

Solution (Python):
N = int(input())

sum = 0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if u == 'BTC':
        x *= 380000.0
    sum += x
print(sum)

Solution (Python):
n=int(input())
ans=0
for i in range(n):
    a,b=input().split()
    if b=="JPY":ans+=float(a)
    else:ans+=float(a)*380000
print(ans)

Solution (Python):
n=int(input())
s=0
for _ in range(n):
  x,u=input().split()
  s+=float(x) if u=='JPY' else 380000*float(x)
print(s)

Solution (Python):
n = int(input())
l = []
m = []
a = 0
b = 0
for i in range(n):
    x,u = map(str,input().split())
    l.append(float(x))
    m.append(u)
for i in range(n):
    if m[i] == "JPY":
        a += l[i]
    elif m[i] == "BTC":
        b += l[i]
print(a+b*380000)

Solution (Python):
N = int(input())
X = []
U = []
total = 0
for i in range(N):
    a,b = map(str, input().split())
    X.append(a)
    U.append(b)

for i in range(len(X)):
    if U[i] == "JPY":
        total += int(X[i])
    else:
        n = float(X[i]) * 380000
        total += n
print(total)

Solution (Python):
N = int(input())
kane = 0
for i in range(N):
    x, u = map(str, input().split())
    if u == 'BTC':
        kane += float(x) * 380000.0
    else:
        kane += int(x)
        
print(kane)

Solution (Python):





















import sys

N = int(input())

a = [i.strip().split() for i in sys.stdin.readlines()]

ans = 0

for b, c in a:
    if c == 'JPY':
        ans += int(b)
    else:
        ans += float(b) * 380000

print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    x, u = map(str,input().split())
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x*380000

print(ans)

Solution (Python):
n = int(input())

sum = 0
for i in range(n):
    x, u = map(str, input().split())
    if u == "JPY":
        sum += int(x)
    elif u == "BTC":
        sum += float(x) * 380000.0

print(sum)

Solution (Python):
n = int(input())

s = 0

for _ in range(n):
    a, b = input().split()
    a = float(a)
    if b == "JPY":
        s += a
    else:
        s += a * 380000

print(s)

Solution (Python):
N=int(input())
btc=0
jpy=0
for j in range(N):
  x,u=input().split()
  if u=="JPY":
    jpy+=int(x)
  else:
    btc+=float(x)
print(jpy+btc*380000)

Solution (Python):
num = int(input())
dic = { "JPY": 0, "BTC": 0 }
for i in range(0, num):
    val, coin = input().split(' ')
    dic[coin] += float(val)
print(dic["JPY"] + (dic["BTC"] * 380000.0))

Solution (Python):
N = int(input())
sum = 0.0

for i in range(N):
    x, u = input().split()
    if u == "BTC":
        x = float(x) * 380000.0
    sum += float(x)

print(sum)

Solution (Python):
N = int(input())
ans = 0.0
for i in range(N):
    x, u = input().split()
    x = float(x)
    if(u=="JPY"):
        ans += x
    else:
        ans += x * 380000

print(ans)

Solution (Python):
n=int(input())
A=[list(input().split()) for i in range(n)]
ans=0.0
for i in range(n):
    if A[i][1]=="JPY":
        ans+=float(A[i][0])
    else:
        ans+=float(A[i][0])*380000.0
print(ans)

Solution (Python):
n = int(input())
sum_money = 0
for i in range(n):
  x,u = input().split()
  int_x = float(x)
  
  if u == 'BTC':
    int_x *= 380000.0
  sum_money += int_x
print(sum_money)

Solution (Python):
N = int(input())
ans = 0.0
for _ in range(N):
    x,u = input().split()
    if u=="JPY":
        ans += int(x)
    else:
        ans += float(x) * 380000
        
print(ans)

Solution (Python):
N=int(input())
k=380000
ans=0
for i in range(N):
  x,u=input().split()
  if u == 'JPY':
    ans += float(x)
  else:
    ans += float(x)*k
print(ans)

Solution (Python):
n=int(input())
print(sum(map(lambda x: float(x[0])*(1 if x[1] == 'JPY' else 380000.0), [input().split() for i in range(n)])))

Solution (Python):
n = int(input())
sum_money = 0
for i in range(n):
    x, u = input().split()
    int_x = float(x)
    if u == "BTC":
        int_x *= 380000
    sum_money += int_x

print(sum_money)

Solution (Python):
N = int(input())
rate = 380000.0
ans = 0.0

for i in range(N):
    x, u = input().split()
    x = float(x)
    ans += x * rate if u == 'BTC' else x
    
print('{:.11f}'.format(ans))

Solution (Python):
a = 0
for i in range(int(input())):
  v,u = input().split()
  if u == "JPY":
    a += int(v)
  else:
    a += float(v)*380000
print(a)

Solution (Python):
import sys

n = int(input())
money = 0
for i in range(n):
	y = sys.stdin.readline().rstrip('\n')
	a,b = y.split(' ')
	x = float(a)
	if b == 'JPY':
		money = money + x
	else:
		money = money + x * 380000.0

print(money)

Solution (Python):
N = int(input())

ans = 0
for _ in range(N):
    x,u = input().split()
    x = float(x)
    if u == "BTC":
        x *= 380000
    ans += x

print(ans)

Solution (Python):
N=int(input())
res=0.0
for _ in range(N):
  mon,sib=input().split()
  if sib=='JPY':
    res+=float(mon)
  elif sib=='BTC':
    res+=float(mon)*380000.0
print(res)

Solution (Python):
N = int(input())

gifts = []
for _ in range(N):
    x, u = map(str, input().split())
    gifts.append([float(x), u])
    
ans = 0.0
for g in gifts:
    x = g[0]
    u = g[1]
    
    if u == 'JPY':
        ans += x
    
    if u == 'BTC':
        ans += x * 380000.0

print(ans)

Solution (Python):
N = int(input())
btc = 380000
ans = 0
for i in range(N):
    x,u = map(str,input().split())
    x = float(x)
    if u=='BTC':
        x *= btc
    ans += x
print(ans)

Solution (Python):
n = int(input())
sum = 0
for _ in range(n):
    x,u = input().split()
    if str(u) == "BTC":
        sum += float(x) * 380000.0
    else:
        sum += float(x)
print(sum)

Solution (Python):
n = int(input())
m = 0

for i in range(0, n):
    money = input().split()
    if(money[1] == "JPY"):
        m += int(money[0])
    else:
        m += float(money[0]) * 380000

print(m)

Solution (Python):
N = int(input())
A = [list(map(str, input().split())) for _ in range(N)]
ans = 0

for value, unit in A:
    if unit == "BTC":
        ans += float(value)*380000
    else:
        ans += float(value)

print(ans)

Solution (Python):
n=int(input())
x=[]
u=[]
for i in range(n):
    xu = list(map(str,input().split()))
    x.append(float(xu[0]))
    mon = xu[1]
    if mon == "JPY":
        u.append(1)
    else:
        u.append(380000)
s = 0
for i in range(n):
    s = s + x[i]*u[i]
print(s)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
  a, t = input().split()
  if t == 'JPY':
    ans += int(a)
  elif t == 'BTC':
    ans += float(a) * 380000.0
print(ans)

Solution (Python):
n = int(input())
tot = 0

for _ in range(n):
    L = list(input().split())
    if L[1] == "JPY":
        tot += int(L[0])
    else:
        tot += float(L[0])*380000.0

print(tot)

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    x, v = input().split()
    x = float(x)
    if v == "BTC":
        x *= 380000
    ans += x 
print(ans)

Solution (Python):
n=int(input())
sum=0
for _ in range(n):
  x,y=map(str,input().split())
  if y=='JPY':
    sum+=int(x)
  else:
    sum+=float(x)*380000
print(sum)

Solution (Python):

N = int(input())
ans = 0
for i in range(N):
    x, v = input().split()
    x = float(x)
    if v == "BTC":
        x *= 380000
    ans += x 
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        ans += x
    else:
        ans += x * 380000
print(ans)

Solution (Python):
n = int(input())
sum = 0
for _ in range(n):
    x, u = input().split()
    if u =='JPY':
        sum+=(float(x))
    else:
        sum+=(float(x)*380000)
print("{:.5f}".format(sum))

Solution (Python):
n = int(input())
xu = [input().split() for i in range(n)]
for i in xu:
    i[0] = float(i[0])

for i in xu:
    if i[1] == 'BTC':
        i[0] *= 380000

print(sum(xu[i][0] for i in range(n)))

Solution (Python):
N=int(input())
X=[]
U=[]
for i in range(N):
    x,u=input().split()
    X.append(float(x))
    U.append(u)
    if U[i]=='BTC':
        X[i]=380000*X[i]
print(sum(X))

Solution (Python):
N = int(input())
ans = 0

for i in range(N):
  a,b = map(str, input().split())
  if b =="JPY":
    ans += int(a)
  else:
    ans += float(a)*380000
print(ans)

Solution (Python):
N = int(input())
Y = 0
unit = {'JPY':1.0, 'BTC':380000.0}
for _ in range(N):
    x, u = [s for s in input().split(' ')]
    Y += float(x) * unit[u]
print(Y)