a=int(input())
b=[]
for _ in range(a):
    b.append(list(map(str,input().split())))
ans=0
for i in range(a):
    if b[i][1]=='JPY':
        ans+=int(b[i][0])
    else:
        ans+=float((b[i][0]))* 380000
print(ans) a=int(input()) a int(input()) int input() input b=[] b [] for _ in range(a):
    b.append(list(map(str,input().split()))) _ range(a) range a b.append(list(map(str,input().split()))) b.append b append list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split ans=0 ans 0 for i in range(a):
    if b[i][1]=='JPY':
        ans+=int(b[i][0])
    else:
        ans+=float((b[i][0]))* 380000 i range(a) range a if b[i][1]=='JPY':
        ans+=int(b[i][0])
    else:
        ans+=float((b[i][0]))* 380000 b[i][1]=='JPY' b[i][1] [i] b i 1 'JPY' ans+=int(b[i][0]) ans int(b[i][0]) int b[i][0] [i] b i 0 ans+=float((b[i][0]))* 380000 ans float((b[i][0]))* 380000 float((b[i][0])) float b[i][0] [i] b i 0 380000 print(ans) print ans ans=0 0 ans a=int(input()) int(input()) a b=[] [] b ans+=int(b[i][0]) int(b[i][0]) ans ans+=float((b[i][0]))* 380000 float((b[i][0]))* 380000 ans
a=int(input())
b=[]
for _ in range(a):
    b.append(list(map(str,input().split())))
ans=0
for i in range(a):
    if b[i][1]=='JPY':
        ans+=int(b[i][0])
    else:
        ans+=float((b[i][0]))* 380000
print(ans)