N=int(input())
list=[]
for i in range(N):
  a,b=input().split()
  list.append((float(a), b))
sum=0
for i in range(N):
  if list[i][1]=="JPY" :
    sum+=list[i][0]
  else :
    sum+=list[i][0]*380000
print(sum) N=int(input()) N int(input()) int input() input list=[] list [] for i in range(N):
  a,b=input().split()
  list.append((float(a), b)) i range(N) range N a,b=input().split() a input().split() ().split () input split b list.append((float(a), b)) list.append list append (float(a), b) float(a) float a b sum=0 sum 0 for i in range(N):
  if list[i][1]=="JPY" :
    sum+=list[i][0]
  else :
    sum+=list[i][0]*380000 i range(N) range N if list[i][1]=="JPY" :
    sum+=list[i][0]
  else :
    sum+=list[i][0]*380000 list[i][1]=="JPY" list[i][1] [i] list i 1 "JPY" sum+=list[i][0] sum list[i][0] [i] list i 0 sum+=list[i][0]*380000 sum list[i][0]*380000 list[i][0] [i] list i 0 380000 print(sum) print sum sum=0 0 sum list=[] [] list a,b=input().split() input().split() a b=input().split() input().split() b N=int(input()) int(input()) N sum+=list[i][0] list[i][0] sum sum+=list[i][0]*380000 list[i][0]*380000 sum
N=int(input())
list=[]
for i in range(N):
  a,b=input().split()
  list.append((float(a), b))
sum=0
for i in range(N):
  if list[i][1]=="JPY" :
    sum+=list[i][0]
  else :
    sum+=list[i][0]*380000
print(sum)