n = int(input())
#d = {"JPY":0,"BTC":0}
x = 0
for i in range(n):
  a,u = input().split()
  a = float(a)
  if u=="JPY":
    x += a
  elif u=="BTC":
    x += (a*380000.0)
print(x) n = int(input()) n int(input()) int input() input x = 0 x 0 for i in range(n):
  a,u = input().split()
  a = float(a)
  if u=="JPY":
    x += a
  elif u=="BTC":
    x += (a*380000.0) i range(n) range n a,u = input().split() a input().split() ().split () input split u a = float(a) a float(a) float a if u=="JPY":
    x += a
  elif u=="BTC":
    x += (a*380000.0) u=="JPY" u "JPY" x += a x a elif u=="BTC":
    x += (a*380000.0) u=="BTC" u "BTC" x += (a*380000.0) x a*380000.0 a 380000.0 print(x) print x x += a a x a = float(a) float(a) a x += (a*380000.0) a*380000.0 x n = int(input()) int(input()) n a,u = input().split() input().split() a u = input().split() input().split() u x = 0 0 x
n = int(input())
#d = {"JPY":0,"BTC":0}
x = 0
for i in range(n):
  a,u = input().split()
  a = float(a)
  if u=="JPY":
    x += a
  elif u=="BTC":
    x += (a*380000.0)
print(x)