N = int(input())
m = []
for i in range(N):
  x, u = input().split(" ")
  if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000)

print(sum(m)) N = int(input()) N int(input()) int input() input m = [] m [] for i in range(N):
  x, u = input().split(" ")
  if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000) i range(N) range N x, u = input().split(" ") x input().split(" ") ().split () input split " " u if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000) u == 'JPY' u 'JPY' m.append(int(x)) m.append m append int(x) int x elif u == 'BTC':
    m.append(float(x) * 380000) u == 'BTC' u 'BTC' m.append(float(x) * 380000) m.append m append float(x) * 380000 float(x) float x 380000 print(sum(m)) print sum(m) sum m N = int(input()) int(input()) N x, u = input().split(" ") input().split(" ") x u = input().split(" ") input().split(" ") u m = [] [] m
N = int(input())
m = []
for i in range(N):
  x, u = input().split(" ")
  if u == 'JPY':
    m.append(int(x))
  elif u == 'BTC':
    m.append(float(x) * 380000)

print(sum(m))