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