n=int(input())
x=[]
u=[]
for i in range(n):
    X,U=input().split()
    x.append(float(X))
    u.append(U)
    X=""
    U=""
#print(x)
#print(u)
sum=0
for i in range(n):
    if u[i]=="JPY":
        sum+=x[i]
    elif u[i]=="BTC":
        sum+=x[i]*380000.0
print(sum) n=int(input()) n int(input()) int input() input x=[] x [] u=[] u [] for i in range(n):
    X,U=input().split()
    x.append(float(X))
    u.append(U)
    X=""
    U=""
#print(x)
#print(u) i range(n) range n X,U=input().split() X input().split() ().split () input split U x.append(float(X)) x.append x append float(X) float X u.append(U) u.append u append U X="" X "" U="" U "" sum=0 sum 0 for i in range(n):
    if u[i]=="JPY":
        sum+=x[i]
    elif u[i]=="BTC":
        sum+=x[i]*380000.0 i range(n) range n if u[i]=="JPY":
        sum+=x[i]
    elif u[i]=="BTC":
        sum+=x[i]*380000.0 u[i]=="JPY" u[i] u i "JPY" sum+=x[i] sum x[i] x i elif u[i]=="BTC":
        sum+=x[i]*380000.0 u[i]=="BTC" u[i] u i "BTC" sum+=x[i]*380000.0 sum x[i]*380000.0 x[i] x i 380000.0 print(sum) print sum X,U=input().split() input().split() X sum+=x[i] x[i] sum u=[] [] u n=int(input()) int(input()) n sum=0 0 sum X="" "" X sum+=x[i]*380000.0 x[i]*380000.0 sum U=input().split() input().split() U U="" "" U x=[] [] x
n=int(input())
x=[]
u=[]
for i in range(n):
    X,U=input().split()
    x.append(float(X))
    u.append(U)
    X=""
    U=""
#print(x)
#print(u)
sum=0
for i in range(n):
    if u[i]=="JPY":
        sum+=x[i]
    elif u[i]=="BTC":
        sum+=x[i]*380000.0
print(sum)