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