N = int(input())

ans_jpy = 0
ans_btc = 0
for i in range(N):
    x, u = map(str, input().split())
    if u == "JPY":
        ans_jpy += int(x)
    else:
        ans_btc += float(x)
    
print(ans_jpy + ans_btc*380000) N = int(input()) N int(input()) int input() input ans_jpy = 0 ans_jpy 0 ans_btc = 0 ans_btc 0 for i in range(N):
    x, u = map(str, input().split())
    if u == "JPY":
        ans_jpy += int(x)
    else:
        ans_btc += float(x)
     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_jpy += int(x)
    else:
        ans_btc += float(x)
     u == "JPY" u "JPY" ans_jpy += int(x) ans_jpy int(x) int x ans_btc += float(x) ans_btc float(x) float x print(ans_jpy + ans_btc*380000) print ans_jpy + ans_btc*380000 ans_jpy ans_btc*380000 ans_btc 380000 x, u = map(str, input().split()) map(str, input().split()) x ans_jpy += int(x) int(x) ans_jpy u = map(str, input().split()) map(str, input().split()) u ans_jpy = 0 0 ans_jpy ans_btc = 0 0 ans_btc N = int(input()) int(input()) N ans_btc += float(x) float(x) ans_btc
N = int(input())

ans_jpy = 0
ans_btc = 0
for i in range(N):
    x, u = map(str, input().split())
    if u == "JPY":
        ans_jpy += int(x)
    else:
        ans_btc += float(x)
    
print(ans_jpy + ans_btc*380000)
