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