n=int(input())
J,B=0,0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        J+=int(x)
    else:
        B+=float(x)

ans=J+B*380000
print(ans) n=int(input()) n int(input()) int input() input J,B=0,0 J 0 B 0 for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        J+=int(x)
    else:
        B+=float(x) i range(n) range n x,u=map(str,input().split()) x map(str,input().split()) map str input().split() ().split () input split u if u=="JPY":
        J+=int(x)
    else:
        B+=float(x) u=="JPY" u "JPY" J+=int(x) J int(x) int x B+=float(x) B float(x) float x ans=J+B*380000 ans J+B*380000 J B*380000 B 380000 print(ans) print ans B=0,0 0 B B+=float(x) float(x) B ans=J+B*380000 J+B*380000 ans x,u=map(str,input().split()) map(str,input().split()) x J,B=0,0 0 J u=map(str,input().split()) map(str,input().split()) u n=int(input()) int(input()) n J+=int(x) int(x) J
n=int(input())
J,B=0,0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        J+=int(x)
    else:
        B+=float(x)

ans=J+B*380000
print(ans)