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