N = int(input())
ans = 0
for i in range(N):
    x,u = map(str,input().split())
    if(u == "JPY"):
        ans += int(x)
    else:
        x = x.replace(".","")
        ans += (int(x) * 380000 / 10**8)
print(str(ans)) N = int(input()) N int(input()) int input() input ans = 0 ans 0 for i in range(N):
    x,u = map(str,input().split())
    if(u == "JPY"):
        ans += int(x)
    else:
        x = x.replace(".","")
        ans += (int(x) * 380000 / 10**8) i range(N) range N x,u = map(str,input().split()) x map(str,input().split()) map str input().split() ().split () input split u if(u == "JPY"):
        ans += int(x)
    else:
        x = x.replace(".","")
        ans += (int(x) * 380000 / 10**8) u == "JPY" u "JPY" ans += int(x) ans int(x) int x x = x.replace(".","") x x.replace(".","") x.replace x replace "." "" ans += (int(x) * 380000 / 10**8) ans int(x) * 380000 / 10**8 int(x) * 380000 int(x) int x 380000 10**8 10 8 print(str(ans)) print str(ans) str ans x = x.replace(".","") x.replace(".","") x ans = 0 0 ans ans += (int(x) * 380000 / 10**8) int(x) * 380000 / 10**8 ans x,u = map(str,input().split()) map(str,input().split()) x u = map(str,input().split()) map(str,input().split()) u ans += int(x) int(x) ans N = int(input()) int(input()) N
N = int(input())
ans = 0
for i in range(N):
    x,u = map(str,input().split())
    if(u == "JPY"):
        ans += int(x)
    else:
        x = x.replace(".","")
        ans += (int(x) * 380000 / 10**8)
print(str(ans))