B = 380000
N = int(input())
res = 0
for _ in range(N):
    x, v = input().split()
    x = float(x)
    if v=="JPY":
       res += x
    else:
        res += x*B
print(res) B = 380000 B 380000 N = int(input()) N int(input()) int input() input res = 0 res 0 for _ in range(N):
    x, v = input().split()
    x = float(x)
    if v=="JPY":
       res += x
    else:
        res += x*B _ range(N) range N x, v = input().split() x input().split() ().split () input split v x = float(x) x float(x) float x if v=="JPY":
       res += x
    else:
        res += x*B v=="JPY" v "JPY" res += x res x res += x*B res x*B x B print(res) print res x, v = input().split() input().split() x res += x*B x*B res B = 380000 380000 B res += x x res res = 0 0 res v = input().split() input().split() v N = int(input()) int(input()) N x = float(x) float(x) x
B = 380000
N = int(input())
res = 0
for _ in range(N):
    x, v = input().split()
    x = float(x)
    if v=="JPY":
       res += x
    else:
        res += x*B
print(res)