n=int(input())
jpy=btc=0
for i in range(n):
    x,u = map(str,input().split())
    if u=="JPY":
        jpy+=int(x)
    else:
        btc+=float(x)

ans = jpy+380000.0*btc
print(ans) n=int(input()) n int(input()) int input() input jpy=btc=0 jpy 0 =btc=0 btc 0 for i in range(n):
    x,u = map(str,input().split())
    if u=="JPY":
        jpy+=int(x)
    else:
        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":
        jpy+=int(x)
    else:
        btc+=float(x) u=="JPY" u "JPY" jpy+=int(x) jpy int(x) int x btc+=float(x) btc float(x) float x ans = jpy+380000.0*btc ans jpy+380000.0*btc jpy 380000.0*btc 380000.0 btc print(ans) print ans btc+=float(x) float(x) btc jpy=btc=0 0 jpy u = map(str,input().split()) map(str,input().split()) u ans = jpy+380000.0*btc jpy+380000.0*btc ans n=int(input()) int(input()) n jpy+=int(x) int(x) jpy btc=0 0 btc x,u = map(str,input().split()) map(str,input().split()) x
n=int(input())
jpy=btc=0
for i in range(n):
    x,u = map(str,input().split())
    if u=="JPY":
        jpy+=int(x)
    else:
        btc+=float(x)

ans = jpy+380000.0*btc
print(ans)