n=int(input())
ans=0.0
for _ in range(n):
  arr = input().split()
  if arr[1]=="JPY":
    ans+=float(arr[0])
  else:
    ans+=float(arr[0])*380000.0

    
print(ans) n=int(input()) n int(input()) int input() input ans=0.0 ans 0.0 for _ in range(n):
  arr = input().split()
  if arr[1]=="JPY":
    ans+=float(arr[0])
  else:
    ans+=float(arr[0])*380000.0

     _ range(n) range n arr = input().split() arr input().split() ().split () input split if arr[1]=="JPY":
    ans+=float(arr[0])
  else:
    ans+=float(arr[0])*380000.0

     arr[1]=="JPY" arr[1] arr 1 "JPY" ans+=float(arr[0]) ans float(arr[0]) float arr[0] arr 0 ans+=float(arr[0])*380000.0 ans float(arr[0])*380000.0 float(arr[0]) float arr[0] arr 0 380000.0 print(ans) print ans n=int(input()) int(input()) n ans+=float(arr[0]) float(arr[0]) ans ans+=float(arr[0])*380000.0 float(arr[0])*380000.0 ans ans=0.0 0.0 ans arr = input().split() input().split() arr
n=int(input())
ans=0.0
for _ in range(n):
  arr = input().split()
  if arr[1]=="JPY":
    ans+=float(arr[0])
  else:
    ans+=float(arr[0])*380000.0

    
print(ans)