# ABC119B

n = int(input())

z = 0
for i in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z) n = int(input()) n int(input()) int input() input z = 0 z 0 for i in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000 i 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':
        z += x
    else:
        z += x*380000 y == 'JPY' y 'JPY' z += x z x z += x*380000 z x*380000 x 380000 print(z) print z x = float(x) float(x) x z = 0 0 z z += x*380000 x*380000 z n = int(input()) int(input()) n x, y = input().split() input().split() x y = input().split() input().split() y z += x x z
# ABC119B

n = int(input())

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