n = int(input())
 
ans = 0
for i in range(n):
    l = input().split()
    if l[1] == "BTC":
        ans += float(l[0])*380000
    else:
        ans += int(l[0])

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

print(ans)