n = int(input())

ab = [list(input().split()) for _ in range(n)]
jpy =0
btc =0

for i in range(n):
    if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0])

print (jpy + btc *380000.0) n = int(input()) n int(input()) int input() input list(input().split()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(input().split()) list input().split() ().split () input split ab = [list(input().split()) for _ in range(n)] ab [list(input().split()) for _ in range(n)] jpy =0 jpy 0 btc =0 btc 0 for i in range(n):
    if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0]) i range(n) range n if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0]) ab[i][1] =="JPY" ab[i][1] [i] ab i 1 "JPY" jpy += float(ab[i][0]) jpy float(ab[i][0]) float ab[i][0] [i] ab i 0 elif ab[i][1] =="BTC":
        btc += float(ab[i][0]) ab[i][1] =="BTC" ab[i][1] [i] ab i 1 "BTC" btc += float(ab[i][0]) btc float(ab[i][0]) float ab[i][0] [i] ab i 0 print (jpy + btc *380000.0) print jpy + btc *380000.0 jpy btc *380000.0 btc 380000.0 n = int(input()) int(input()) n ab = [list(input().split()) for _ in range(n)] [list(input().split()) for _ in range(n)] ab jpy += float(ab[i][0]) float(ab[i][0]) jpy jpy =0 0 jpy btc += float(ab[i][0]) float(ab[i][0]) btc btc =0 0 btc
n = int(input())

ab = [list(input().split()) for _ in range(n)]
jpy =0
btc =0

for i in range(n):
    if ab[i][1] =="JPY":
        jpy += float(ab[i][0])
    
    elif ab[i][1] =="BTC":
        btc += float(ab[i][0])

print (jpy + btc *380000.0)