n = int(input())

j, b = 0, 0
for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        j += x
    else:
        b += x
print(j + b*380000) n = int(input()) n int(input()) int input() input j, b = 0, 0 j 0 b 0 for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        j += x
    else:
        b += x _ range(n) range n x, y = input().split() x input().split() ().split () input split y x = float(x) x float(x) float x if y == 'JPY':
        j += x
    else:
        b += x y == 'JPY' y 'JPY' j += x j x b += x b x print(j + b*380000) print j + b*380000 j b*380000 b 380000 b = 0, 0 0 b n = int(input()) int(input()) n j, b = 0, 0 0 j x, y = input().split() input().split() x b += x x b y = input().split() input().split() y j += x x j x = float(x) float(x) x
n = int(input())

j, b = 0, 0
for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        j += x
    else:
        b += x
print(j + b*380000)