n=int(input())
a=0
for i in range(n):
  m, curr=input().split()
  m=float(m)
  curr=str(curr)
  if curr=='BTC':
    a=a+m*380000
  else:
    a=a+m
print(a) n=int(input()) n int(input()) int input() input a=0 a 0 for i in range(n):
  m, curr=input().split()
  m=float(m)
  curr=str(curr)
  if curr=='BTC':
    a=a+m*380000
  else:
    a=a+m i range(n) range n m, curr=input().split() m input().split() ().split () input split curr m=float(m) m float(m) float m curr=str(curr) curr str(curr) str curr if curr=='BTC':
    a=a+m*380000
  else:
    a=a+m curr=='BTC' curr 'BTC' a=a+m*380000 a a+m*380000 a m*380000 m 380000 a=a+m a a+m a m print(a) print a a=0 0 a m=float(m) float(m) m m, curr=input().split() input().split() m n=int(input()) int(input()) n curr=input().split() input().split() curr curr=str(curr) str(curr) curr a=a+m a+m a a=a+m*380000 a+m*380000 a
n=int(input())
a=0
for i in range(n):
  m, curr=input().split()
  m=float(m)
  curr=str(curr)
  if curr=='BTC':
    a=a+m*380000
  else:
    a=a+m
print(a)
