n = int(input())
res = 0
for i in range(n):
  a,b = map(str, input().split())
  if b == 'JPY':
    res += float(a)
  else:
    res += float(a) * 380000.0
print(res) n = int(input()) n int(input()) int input() input res = 0 res 0 for i in range(n):
  a,b = map(str, input().split())
  if b == 'JPY':
    res += float(a)
  else:
    res += float(a) * 380000.0 i range(n) range n a,b = map(str, input().split()) a map(str, input().split()) map str input().split() ().split () input split b if b == 'JPY':
    res += float(a)
  else:
    res += float(a) * 380000.0 b == 'JPY' b 'JPY' res += float(a) res float(a) float a res += float(a) * 380000.0 res float(a) * 380000.0 float(a) float a 380000.0 print(res) print res b = map(str, input().split()) map(str, input().split()) b n = int(input()) int(input()) n a,b = map(str, input().split()) map(str, input().split()) a res += float(a) * 380000.0 float(a) * 380000.0 res res = 0 0 res res += float(a) float(a) res
n = int(input())
res = 0
for i in range(n):
  a,b = map(str, input().split())
  if b == 'JPY':
    res += float(a)
  else:
    res += float(a) * 380000.0
print(res)