n=int(input())

s=0

for i in range(n):
    a,u=input().split()
    if u=="JPY":
        s+=int(a)
    else:
        s+=float(a)* 380000
        
print(s) n=int(input()) n int(input()) int input() input s=0 s 0 for i in range(n):
    a,u=input().split()
    if u=="JPY":
        s+=int(a)
    else:
        s+=float(a)* 380000
         i range(n) range n a,u=input().split() a input().split() ().split () input split u if u=="JPY":
        s+=int(a)
    else:
        s+=float(a)* 380000
         u=="JPY" u "JPY" s+=int(a) s int(a) int a s+=float(a)* 380000 s float(a)* 380000 float(a) float a 380000 print(s) print s n=int(input()) int(input()) n s+=int(a) int(a) s s+=float(a)* 380000 float(a)* 380000 s a,u=input().split() input().split() a u=input().split() input().split() u s=0 0 s
n=int(input())

s=0

for i in range(n):
    a,u=input().split()
    if u=="JPY":
        s+=int(a)
    else:
        s+=float(a)* 380000
        
print(s)
