n = int(input())
jp, bit = 0, 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jp += float(a)
  else:
    bit += float(a)
print(jp+380000*bit) n = int(input()) n int(input()) int input() input jp, bit = 0, 0 jp 0 bit 0 for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jp += float(a)
  else:
    bit += float(a) i range(n) range n a, b = input().split() a input().split() ().split () input split b if b == "JPY":
    jp += float(a)
  else:
    bit += float(a) b == "JPY" b "JPY" jp += float(a) jp float(a) float a bit += float(a) bit float(a) float a print(jp+380000*bit) print jp+380000*bit jp 380000*bit 380000 bit jp, bit = 0, 0 0 jp jp += float(a) float(a) jp bit = 0, 0 0 bit a, b = input().split() input().split() a bit += float(a) float(a) bit n = int(input()) int(input()) n b = input().split() input().split() b
n = int(input())
jp, bit = 0, 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jp += float(a)
  else:
    bit += float(a)
print(jp+380000*bit)