import sys
N = int(input())
array = [ list(map(str,input().split())) for I in range(N) ]
# print(array)
for I in array:
    if not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ): sys.exit()

amount = 0
for I in array:
    if I[1] == 'JPY': amount += int(I[0])
    if I[1] == 'BTC': amount += float(I[0]) * 380000

print(amount) import sys sys N = int(input()) N int(input()) int input() input list(map(str,input().split())) for I in range(N) for I in range(N) I range(N) range N for I in range(N) list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split array = [ list(map(str,input().split())) for I in range(N) ] array [ list(map(str,input().split())) for I in range(N) ] for I in array:
    if not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ): sys.exit() I array if not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ): sys.exit() not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ) not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 I[1] == 'JPY' I[1] I 1 'JPY' 1 <= int(I[0]) <= 10 ** 8 1 <= int(I[0]) 1 int(I[0]) int I[0] I 0 10 ** 8 10 8 not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ) I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 I[1] == 'BTC' I[1] I 1 'BTC' 1/10 ** 8 <= float(I[0]) <= 100 1/10 ** 8 <= float(I[0]) 1/10 ** 8 1 10 ** 8 10 8 float(I[0]) float I[0] I 0 100 amount = 0 amount 0 for I in array:
    if I[1] == 'JPY': amount += int(I[0])
    if I[1] == 'BTC': amount += float(I[0]) * 380000 I array if I[1] == 'JPY': amount += int(I[0])
     I[1] == 'JPY' I[1] I 1 'JPY' if I[1] == 'BTC': amount += float(I[0]) * 38 I[1] == 'BTC' I[1] I 1 'BTC' print(amount) print amount amount = 0 0 amount N = int(input()) int(input()) N array = [ list(map(str,input().split())) for I in range(N) ] [ list(map(str,input().split())) for I in range(N) ] array
import sys
N = int(input())
array = [ list(map(str,input().split())) for I in range(N) ]
# print(array)
for I in array:
    if not ( I[1] == 'JPY' and 1 <= int(I[0]) <= 10 ** 8 ) and \
    not ( I[1] == 'BTC' and 1/10 ** 8 <= float(I[0]) <= 100 ): sys.exit()

amount = 0
for I in array:
    if I[1] == 'JPY': amount += int(I[0])
    if I[1] == 'BTC': amount += float(I[0]) * 380000

print(amount)