N = int(input())

ans = 0
for _ in range(N):
    x, u = input().split()
    x = float(x)
    ans += x if u == 'JPY' else x * 380000
print(ans) N = int(input()) N int(input()) int input() input ans = 0 ans 0 for _ in range(N):
    x, u = input().split()
    x = float(x)
    ans += x if u == 'JPY' else x * 380000 _ range(N) range N x, u = input().split() x input().split() ().split () input split u x = float(x) x float(x) float x ans += x if u == 'JPY' else x * 380000 ans x if u == 'JPY' else x * 380000 u == 'JPY' u 'JPY' x x * 380000 x 380000 print(ans) print ans ans += x if u == 'JPY' else x * 380000 x if u == 'JPY' else x * 380000 ans x = float(x) float(x) x u = input().split() input().split() u ans = 0 0 ans N = int(input()) int(input()) N x, u = input().split() input().split() x
N = int(input())

ans = 0
for _ in range(N):
    x, u = input().split()
    x = float(x)
    ans += x if u == 'JPY' else x * 380000
print(ans)
