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