N = int(input())
ans = 0.0
for i in range(N):
  A,B = input().split()
  if B == "BTC":
    ans += 380000.0 * float(A)
  else:
    ans += float(A)
print(ans) N = int(input()) N int(input()) int input() input ans = 0.0 ans 0.0 for i in range(N):
  A,B = input().split()
  if B == "BTC":
    ans += 380000.0 * float(A)
  else:
    ans += float(A) i range(N) range N A,B = input().split() A input().split() ().split () input split B if B == "BTC":
    ans += 380000.0 * float(A)
  else:
    ans += float(A) B == "BTC" B "BTC" ans += 380000.0 * float(A) ans 380000.0 * float(A) 380000.0 float(A) float A ans += float(A) ans float(A) float A print(ans) print ans B = input().split() input().split() B N = int(input()) int(input()) N ans = 0.0 0.0 ans ans += 380000.0 * float(A) 380000.0 * float(A) ans ans += float(A) float(A) ans A,B = input().split() input().split() A
N = int(input())
ans = 0.0
for i in range(N):
  A,B = input().split()
  if B == "BTC":
    ans += 380000.0 * float(A)
  else:
    ans += float(A)
print(ans)