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

