n=int(input())
x=[]
u=[]
yen=0
bit=0
for i in range(n):
    a,b=input().split()
    x.append(float(a))
    u.append(b)
for i in range(n):
    if u[i]=="JPY":
        yen+=x[i]
    else:
        bit+=x[i]
print(yen+380000*bit) n=int(input()) n int(input()) int input() input x=[] x [] u=[] u [] yen=0 yen 0 bit=0 bit 0 for i in range(n):
    a,b=input().split()
    x.append(float(a))
    u.append(b) i range(n) range n a,b=input().split() a input().split() ().split () input split b x.append(float(a)) x.append x append float(a) float a u.append(b) u.append u append b for i in range(n):
    if u[i]=="JPY":
        yen+=x[i]
    else:
        bit+=x[i] i range(n) range n if u[i]=="JPY":
        yen+=x[i]
    else:
        bit+=x[i] u[i]=="JPY" u[i] u i "JPY" yen+=x[i] yen x[i] x i bit+=x[i] bit x[i] x i print(yen+380000*bit) print yen+380000*bit yen 380000*bit 380000 bit a,b=input().split() input().split() a bit+=x[i] x[i] bit u=[] [] u b=input().split() input().split() b n=int(input()) int(input()) n yen=0 0 yen bit=0 0 bit x=[] [] x yen+=x[i] x[i] yen
n=int(input())
x=[]
u=[]
yen=0
bit=0
for i in range(n):
    a,b=input().split()
    x.append(float(a))
    u.append(b)
for i in range(n):
    if u[i]=="JPY":
        yen+=x[i]
    else:
        bit+=x[i]
print(yen+380000*bit)