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