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

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

print(ans)