n = int(input())
ans = 0
for i in range(n):
  x,n = input().split()
  x = float(x)
  if n == "BTC":
    x *= 380000.0
  ans += x
print(ans) n = int(input()) n int(input()) int input() input ans = 0 ans 0 for i in range(n):
  x,n = input().split()
  x = float(x)
  if n == "BTC":
    x *= 380000.0
  ans += x i range(n) range n x,n = input().split() x input().split() ().split () input split n x = float(x) x float(x) float x if n == "BTC":
    x *= 380000.0
   n == "BTC" n "BTC" x *= 380000.0 x 380000.0 ans += x ans x print(ans) print ans x,n = input().split() input().split() x n = input().split() input().split() n n = int(input()) int(input()) n ans += x x ans x = float(x) float(x) x x *= 380000.0 380000.0 x ans = 0 0 ans
n = int(input())
ans = 0
for i in range(n):
  x,n = input().split()
  x = float(x)
  if n == "BTC":
    x *= 380000.0
  ans += x
print(ans)