n = int(input())
x, u = [0]*n, [0]*n

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

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