n = int(input())
jpy = 0
btc = 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000)
print(jpy+(btc*38/10000)) n = int(input()) n int(input()) int input() input jpy = 0 jpy 0 btc = 0 btc 0 for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000) i range(n) range n a, b = input().split() a input().split() ().split () input split b if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000) b == "JPY" b "JPY" jpy += int(a) jpy int(a) int a btc += int(float(a) * 100000000) btc int(float(a) * 100000000) int float(a) * 100000000 float(a) float a 100000000 print(jpy+(btc*38/10000)) print jpy+(btc*38/10000) jpy btc*38/10000 btc*38 btc 38 10000 a, b = input().split() input().split() a jpy = 0 0 jpy btc += int(float(a) * 100000000) int(float(a) * 100000000) btc btc = 0 0 btc b = input().split() input().split() b n = int(input()) int(input()) n jpy += int(a) int(a) jpy
n = int(input())
jpy = 0
btc = 0
for i in range(n):
  a, b = input().split()
  if b == "JPY":
    jpy += int(a)
  else:
    btc += int(float(a) * 100000000)
print(jpy+(btc*38/10000))