n=int(input())
lists=[]
for t in range(n):
  a,b=input().split()
  lists.append([a,b])
ans=0
for t in range(n):
  if lists[t][1]=='JPY':
    ans+=int(lists[t][0])
  else:
    ans+=float(lists[t][0])*380000
print(ans) n=int(input()) n int(input()) int input() input lists=[] lists [] for t in range(n):
  a,b=input().split()
  lists.append([a,b]) t range(n) range n a,b=input().split() a input().split() ().split () input split b lists.append([a,b]) lists.append lists append [a,b] a b ans=0 ans 0 for t in range(n):
  if lists[t][1]=='JPY':
    ans+=int(lists[t][0])
  else:
    ans+=float(lists[t][0])*380000 t range(n) range n if lists[t][1]=='JPY':
    ans+=int(lists[t][0])
  else:
    ans+=float(lists[t][0])*380000 lists[t][1]=='JPY' lists[t][1] [t] lists t 1 'JPY' ans+=int(lists[t][0]) ans int(lists[t][0]) int lists[t][0] [t] lists t 0 ans+=float(lists[t][0])*380000 ans float(lists[t][0])*380000 float(lists[t][0]) float lists[t][0] [t] lists t 0 380000 print(ans) print ans b=input().split() input().split() b ans+=float(lists[t][0])*380000 float(lists[t][0])*380000 ans n=int(input()) int(input()) n ans+=int(lists[t][0]) int(lists[t][0]) ans lists=[] [] lists a,b=input().split() input().split() a ans=0 0 ans
n=int(input())
lists=[]
for t in range(n):
  a,b=input().split()
  lists.append([a,b])
ans=0
for t in range(n):
  if lists[t][1]=='JPY':
    ans+=int(lists[t][0])
  else:
    ans+=float(lists[t][0])*380000
print(ans)