(n), *l,  = [list(s.split()) for s in open(0)]

sum_m = 0
for x, y in l:
    # print(x)
    # print(y)
    x = float(x)
    if y == 'JPY':
        sum_m += x
    if y == 'BTC':
        sum_m += (x * 380000.0)
        
print(sum_m) list(s.split()) for s in open(0) for s in open(0) s open(0) open 0 for s in open(0) list(s.split()) list s.split() s.split s split (n), *l,  = [list(s.split()) for s in open(0)] n [list(s.split()) for s in open(0)] *l l sum_m = 0 sum_m 0 for x, y in l:
    # print(x)
    # print(y)
    x = float(x)
    if y == 'JPY':
        sum_m += x
    if y == 'BTC':
        sum_m += (x * 380000.0)
         x y l x = float(x) x float(x) float x if y == 'JPY':
        sum_m += x
     y == 'JPY' y 'JPY' sum_m += x sum_m x if y == 'BTC':
        sum_m += (x * 380000.0)
         y == 'BTC' y 'BTC' sum_m += (x * 380000.0) sum_m x * 380000.0 x 380000.0 print(sum_m) print sum_m n), *l,  = [list(s.split()) for s in open(0)] [list(s.split()) for s in open(0)] n sum_m = 0 0 sum_m sum_m += (x * 380000.0) x * 380000.0 sum_m x = float(x) float(x) x sum_m += x x sum_m
(n), *l,  = [list(s.split()) for s in open(0)]

sum_m = 0
for x, y in l:
    # print(x)
    # print(y)
    x = float(x)
    if y == 'JPY':
        sum_m += x
    if y == 'BTC':
        sum_m += (x * 380000.0)
        
print(sum_m)