n = int(input())
c = 0
for i in range(n):
  x,u = input().split()
  if u == "BTC":
    c += float(x)*380000
  else:
    c += int(x)
print(c) n = int(input()) n int(input()) int input() input c = 0 c 0 for i in range(n):
  x,u = input().split()
  if u == "BTC":
    c += float(x)*380000
  else:
    c += int(x) i range(n) range n x,u = input().split() x input().split() ().split () input split u if u == "BTC":
    c += float(x)*380000
  else:
    c += int(x) u == "BTC" u "BTC" c += float(x)*380000 c float(x)*380000 float(x) float x 380000 c += int(x) c int(x) int x print(c) print c n = int(input()) int(input()) n x,u = input().split() input().split() x c += float(x)*380000 float(x)*380000 c c += int(x) int(x) c c = 0 0 c u = input().split() input().split() u
n = int(input())
c = 0
for i in range(n):
  x,u = input().split()
  if u == "BTC":
    c += float(x)*380000
  else:
    c += int(x)
print(c)