n=int(input())

total =0
btc=0
for _ in range(n):
    x,u = input().split()

    x= float(x)

    if u=='JPY':
        total+=x
    else:
        btc+=x

total += btc*380000

print(total) n=int(input()) n int(input()) int input() input total =0 total 0 btc=0 btc 0 for _ in range(n):
    x,u = input().split()

    x= float(x)

    if u=='JPY':
        total+=x
    else:
        btc+=x _ 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':
        total+=x
    else:
        btc+=x u=='JPY' u 'JPY' total+=x total x btc+=x btc x total += btc*380000 total btc*380000 btc 380000 print(total) print total u = input().split() input().split() u total+=x x total total += btc*380000 btc*380000 total total =0 0 total btc+=x x btc n=int(input()) int(input()) n x,u = input().split() input().split() x btc=0 0 btc x= float(x) float(x) x
n=int(input())

total =0
btc=0
for _ in range(n):
    x,u = input().split()

    x= float(x)

    if u=='JPY':
        total+=x
    else:
        btc+=x

total += btc*380000

print(total)