N=int(input())
SUM=0
for i in range(N):
  x,u=input().split()
  x=float(x)
  if u=='BTC':
    x *= 380000.0
  SUM += x
print(SUM) N=int(input()) N int(input()) int input() input SUM=0 SUM 0 for i in range(N):
  x,u=input().split()
  x=float(x)
  if u=='BTC':
    x *= 380000.0
  SUM += 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=='BTC':
    x *= 380000.0
   u=='BTC' u 'BTC' x *= 380000.0 x 380000.0 SUM += x SUM x print(SUM) print SUM SUM=0 0 SUM x *= 380000.0 380000.0 x x,u=input().split() input().split() x u=input().split() input().split() u x=float(x) float(x) x SUM += x x SUM N=int(input()) int(input()) N
N=int(input())
SUM=0
for i in range(N):
  x,u=input().split()
  x=float(x)
  if u=='BTC':
    x *= 380000.0
  SUM += x
print(SUM)