dic = {"JPY":0 , "BTC":0}
N = int(input())
for i in range(0,N,1):
    x,u = input().split()
    x = float(x)
    dic[u]+=x
print(dic["JPY"]+380000*dic["BTC"]) dic = {"JPY":0 , "BTC":0} dic {"JPY":0 , "BTC":0} "JPY" "JPY" 0 "BTC" "BTC" 0 N = int(input()) N int(input()) int input() input for i in range(0,N,1):
    x,u = input().split()
    x = float(x)
    dic[u]+=x i range(0,N,1) range 0 N 1 x,u = input().split() x input().split() ().split () input split u x = float(x) x float(x) float x dic[u]+=x dic[u] dic u x print(dic["JPY"]+380000*dic["BTC"]) print dic["JPY"]+380000*dic["BTC"] dic["JPY"] dic "JPY" 380000*dic["BTC"] 380000 dic["BTC"] dic "BTC" N = int(input()) int(input()) N x,u = input().split() input().split() x dic = {"JPY":0 , "BTC":0} {"JPY":0 , "BTC":0} dic u = input().split() input().split() u x = float(x) float(x) x
dic = {"JPY":0 , "BTC":0}
N = int(input())
for i in range(0,N,1):
    x,u = input().split()
    x = float(x)
    dic[u]+=x
print(dic["JPY"]+380000*dic["BTC"])