n=int(input())
sum = 0
for i in range(n):
  s = input().rstrip().split(' ')
  a=float(s[0])
  b=str(s[1])
  if b == "JPY":
    sum += int(a)
  else:
    sum += float(a)*380000
print(sum) n=int(input()) n int(input()) int input() input sum = 0 sum 0 for i in range(n):
  s = input().rstrip().split(' ')
  a=float(s[0])
  b=str(s[1])
  if b == "JPY":
    sum += int(a)
  else:
    sum += float(a)*380000 i range(n) range n s = input().rstrip().split(' ') s input().rstrip().split(' ') ().rstrip().split ().rstrip() ().rstrip () input rstrip split ' ' a=float(s[0]) a float(s[0]) float s[0] s 0 b=str(s[1]) b str(s[1]) str s[1] s 1 if b == "JPY":
    sum += int(a)
  else:
    sum += float(a)*380000 b == "JPY" b "JPY" sum += int(a) sum int(a) int a sum += float(a)*380000 sum float(a)*380000 float(a) float a 380000 print(sum) print sum s = input().rstrip().split(' ') input().rstrip().split(' ') s b=str(s[1]) str(s[1]) b n=int(input()) int(input()) n sum += int(a) int(a) sum sum += float(a)*380000 float(a)*380000 sum a=float(s[0]) float(s[0]) a sum = 0 0 sum
n=int(input())
sum = 0
for i in range(n):
  s = input().rstrip().split(' ')
  a=float(s[0])
  b=str(s[1])
  if b == "JPY":
    sum += int(a)
  else:
    sum += float(a)*380000
print(sum)