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