n = int(input())
s = 0

for i in range(n):
    x,u = input().split()
    x = float(x)
    if(u == 'JPY'):s += x
    elif(u == 'BTC'):s += x * 380000
print(s) n = int(input()) n int(input()) int input() input s = 0 s 0 for i in range(n):
    x,u = input().split()
    x = float(x)
    if(u == 'JPY'):s += x
    elif(u == 'BTC'):s += x * 380000 i range(n) range n x,u = input().split() x input().split() ().split () input split u x = float(x) x float(x) float x if(u == 'JPY'):s += x
    elif(u == 'BTC'):s += x * 380000 u == 'JPY' u 'JPY' elif(u == 'BTC'):s += x * 38 u == 'BTC' u 'BTC' print(s) print s x,u = input().split() input().split() x x = float(x) float(x) x s = 0 0 s n = int(input()) int(input()) n u = input().split() input().split() u
n = int(input())
s = 0

for i in range(n):
    x,u = input().split()
    x = float(x)
    if(u == 'JPY'):s += x
    elif(u == 'BTC'):s += x * 380000
print(s)