n = int(input())
ans = 0
for i in range(n):
    x = list(map(str,input().split()))
    if x[1] == "JPY":
        ans += int(x[0])
    else:
        ans += float(x[0])*380000
print(ans) n = int(input()) n int(input()) int input() input ans = 0 ans 0 for i in range(n):
    x = list(map(str,input().split()))
    if x[1] == "JPY":
        ans += int(x[0])
    else:
        ans += float(x[0])*380000 i range(n) range n x = list(map(str,input().split())) x list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split if x[1] == "JPY":
        ans += int(x[0])
    else:
        ans += float(x[0])*380000 x[1] == "JPY" x[1] x 1 "JPY" ans += int(x[0]) ans int(x[0]) int x[0] x 0 ans += float(x[0])*380000 ans float(x[0])*380000 float(x[0]) float x[0] x 0 380000 print(ans) print ans x = list(map(str,input().split())) list(map(str,input().split())) x n = int(input()) int(input()) n ans += float(x[0])*380000 float(x[0])*380000 ans ans = 0 0 ans ans += int(x[0]) int(x[0]) ans
n = int(input())
ans = 0
for i in range(n):
    x = list(map(str,input().split()))
    if x[1] == "JPY":
        ans += int(x[0])
    else:
        ans += float(x[0])*380000
print(ans)