n=int(input())
sm=0
for i in range(n):
  x,y=map(str,input().split())
  if y=='JPY':
    sm+=int(x)
  else:
    sm+=float(x)*380000.0
print(sm) n=int(input()) n int(input()) int input() input sm=0 sm 0 for i in range(n):
  x,y=map(str,input().split())
  if y=='JPY':
    sm+=int(x)
  else:
    sm+=float(x)*380000.0 i range(n) range n x,y=map(str,input().split()) x map(str,input().split()) map str input().split() ().split () input split y if y=='JPY':
    sm+=int(x)
  else:
    sm+=float(x)*380000.0 y=='JPY' y 'JPY' sm+=int(x) sm int(x) int x sm+=float(x)*380000.0 sm float(x)*380000.0 float(x) float x 380000.0 print(sm) print sm sm=0 0 sm x,y=map(str,input().split()) map(str,input().split()) x sm+=float(x)*380000.0 float(x)*380000.0 sm n=int(input()) int(input()) n y=map(str,input().split()) map(str,input().split()) y sm+=int(x) int(x) sm
n=int(input())
sm=0
for i in range(n):
  x,y=map(str,input().split())
  if y=='JPY':
    sm+=int(x)
  else:
    sm+=float(x)*380000.0
print(sm)