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