N = int(input())

result = 0

for _ in range(N):
  x, u = input().split()
  x = float(x)
  
  if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
    
print(result) N = int(input()) N int(input()) int input() input result = 0 result 0 for _ in range(N):
  x, u = input().split()
  x = float(x)
  
  if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
     _ range(N) range N x, u = input().split() x input().split() ().split () input split u x = float(x) x float(x) float x if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
     u == "JPY" u "JPY" result += x result x result += x * (3.8 * 10 ** 5) result x * (3.8 * 10 ** 5) x 3.8 * 10 ** 5 3.8 10 ** 5 10 5 print(result) print result result += x * (3.8 * 10 ** 5) x * (3.8 * 10 ** 5) result result += x x result result = 0 0 result x = float(x) float(x) x x, u = input().split() input().split() x N = int(input()) int(input()) N u = input().split() input().split() u
N = int(input())

result = 0

for _ in range(N):
  x, u = input().split()
  x = float(x)
  
  if u == "JPY":
    result += x
  else:
    result += x * (3.8 * 10 ** 5)
    
print(result)