n = int(input())
x=[]
for i in range(n):
  a,b = input().split()
  if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000)
print(sum(x)) n = int(input()) n int(input()) int input() input x=[] x [] for i in range(n):
  a,b = input().split()
  if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000) i range(n) range n a,b = input().split() a input().split() ().split () input split b if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000) b == 'JPY' b 'JPY' x.append(int(a)) x.append x append int(a) int a x.append(float(a)*380000) x.append x append float(a)*380000 float(a) float a 380000 print(sum(x)) print sum(x) sum x a,b = input().split() input().split() a x=[] [] x n = int(input()) int(input()) n b = input().split() input().split() b
n = int(input())
x=[]
for i in range(n):
  a,b = input().split()
  if b == 'JPY':
    x.append(int(a))
  else:
    x.append(float(a)*380000)
print(sum(x))