res=0
for i in range(int(input())):
  x,u=input().split()
  x=float(x)
  res+=x if u>'C'else 380000*x
print(res) res=0 res 0 for i in range(int(input())):
  x,u=input().split()
  x=float(x)
  res+=x if u>'C'else 380000*x i range(int(input())) range int(input()) int input() input x,u=input().split() x input().split() ().split () input split u x=float(x) x float(x) float x res+=x if u>'C'else 380000*x res x if u>'C'else 380000*x u>'C' u 'C' x 380000*x 380000 x print(res) print res x,u=input().split() input().split() x res=0 0 res u=input().split() input().split() u x=float(x) float(x) x res+=x if u>'C'else 380000*x x if u>'C'else 380000*x res
res=0
for i in range(int(input())):
  x,u=input().split()
  x=float(x)
  res+=x if u>'C'else 380000*x
print(res)