N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i], u[i] = map(str, input().split())

ans = 0
for i in range(N):
    if u[i] == 'JPY':
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000

print(ans) N = int(input()) N int(input()) int input() input x = [0] * N x [0] * N [0] 0 N u = [0] * N u [0] * N [0] 0 N for i in range(N):
    x[i], u[i] = map(str, input().split()) 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 ans = 0 ans 0 for i in range(N):
    if u[i] == 'JPY':
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000 i range(N) range N if u[i] == 'JPY':
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000 u[i] == 'JPY' u[i] u i 'JPY' ans += float(x[i]) ans float(x[i]) float x[i] x i ans += float(x[i]) * 380000 ans float(x[i]) * 380000 float(x[i]) float x[i] x i 380000 print(ans) print ans N = int(input()) int(input()) N x = [0] * N [0] * N x ans = 0 0 ans u = [0] * N [0] * N u ans += float(x[i]) float(x[i]) ans ans += float(x[i]) * 380000 float(x[i]) * 380000 ans
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i], u[i] = map(str, input().split())

ans = 0
for i in range(N):
    if u[i] == 'JPY':
        ans += float(x[i])
    else:
        ans += float(x[i]) * 380000

print(ans)
