n = int(input())
money = 0
for _ in range(n):
  p = input().split()
  if p[1] == 'JPY':
    money += int(p[0])
  elif p[1] == 'BTC':
    money += float(p[0]) * 380000

print(money) n = int(input()) n int(input()) int input() input money = 0 money 0 for _ in range(n):
  p = input().split()
  if p[1] == 'JPY':
    money += int(p[0])
  elif p[1] == 'BTC':
    money += float(p[0]) * 380000 _ range(n) range n p = input().split() p input().split() ().split () input split if p[1] == 'JPY':
    money += int(p[0])
  elif p[1] == 'BTC':
    money += float(p[0]) * 380000 p[1] == 'JPY' p[1] p 1 'JPY' money += int(p[0]) money int(p[0]) int p[0] p 0 elif p[1] == 'BTC':
    money += float(p[0]) * 380000 p[1] == 'BTC' p[1] p 1 'BTC' money += float(p[0]) * 380000 money float(p[0]) * 380000 float(p[0]) float p[0] p 0 380000 print(money) print money money += int(p[0]) int(p[0]) money money = 0 0 money p = input().split() input().split() p n = int(input()) int(input()) n money += float(p[0]) * 380000 float(p[0]) * 380000 money
n = int(input())
money = 0
for _ in range(n):
  p = input().split()
  if p[1] == 'JPY':
    money += int(p[0])
  elif p[1] == 'BTC':
    money += float(p[0]) * 380000

print(money)