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