N = int(input())

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

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