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