N=int(input())
ans=0
for i in range(N):
   A,B=list(input().split())
   if B=="JPY":
      ans+=int(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=list(input().split())
   if B=="JPY":
      ans+=int(A)
   else:
      ans+=float(A)*380000 i range(N) range N A,B=list(input().split()) A list(input().split()) list input().split() ().split () input split B if B=="JPY":
      ans+=int(A)
   else:
      ans+=float(A)*380000 B=="JPY" B "JPY" ans+=int(A) ans int(A) int A ans+=float(A)*380000 ans float(A)*380000 float(A) float A 380000 print(ans) print ans ans+=int(A) int(A) ans ans=0 0 ans A,B=list(input().split()) list(input().split()) A B=list(input().split()) list(input().split()) B ans+=float(A)*380000 float(A)*380000 ans N=int(input()) int(input()) N
N=int(input())
ans=0
for i in range(N):
   A,B=list(input().split())
   if B=="JPY":
      ans+=int(A)
   else:
      ans+=float(A)*380000
print(ans)
