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