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