n = int(input())
ans = 0
for i in range(n):
    s = input().split()
    if s[1]=="JPY":
        ans+=int(s[0])
    elif s[1]=="BTC":
        x = float(s[0])
        ans+=x*380000
print(ans) n = int(input()) n int(input()) int input() input ans = 0 ans 0 for i in range(n):
    s = input().split()
    if s[1]=="JPY":
        ans+=int(s[0])
    elif s[1]=="BTC":
        x = float(s[0])
        ans+=x*380000 i range(n) range n s = input().split() s input().split() ().split () input split if s[1]=="JPY":
        ans+=int(s[0])
    elif s[1]=="BTC":
        x = float(s[0])
        ans+=x*380000 s[1]=="JPY" s[1] s 1 "JPY" ans+=int(s[0]) ans int(s[0]) int s[0] s 0 elif s[1]=="BTC":
        x = float(s[0])
        ans+=x*380000 s[1]=="BTC" s[1] s 1 "BTC" x = float(s[0]) x float(s[0]) float s[0] s 0 ans+=x*380000 ans x*380000 x 380000 print(ans) print ans ans = 0 0 ans ans+=int(s[0]) int(s[0]) ans ans+=x*380000 x*380000 ans n = int(input()) int(input()) n s = input().split() input().split() s x = float(s[0]) float(s[0]) x
n = int(input())
ans = 0
for i in range(n):
    s = input().split()
    if s[1]=="JPY":
        ans+=int(s[0])
    elif s[1]=="BTC":
        x = float(s[0])
        ans+=x*380000
print(ans)