n = int(input())
s = 0
for i in range(n):
  a, b = map(str, input().split())
  c = float(a)
  if b != "JPY":
    c = c * 380000.0
  s = c + s
print(s) n = int(input()) n int(input()) int input() input s = 0 s 0 for i in range(n):
  a, b = map(str, input().split())
  c = float(a)
  if b != "JPY":
    c = c * 380000.0
  s = c + s i range(n) range n a, b = map(str, input().split()) a map(str, input().split()) map str input().split() ().split () input split b c = float(a) c float(a) float a if b != "JPY":
    c = c * 380000.0
   b != "JPY" b "JPY" c = c * 380000.0 c c * 380000.0 c 380000.0 s = c + s s c + s c s print(s) print s n = int(input()) int(input()) n b = map(str, input().split()) map(str, input().split()) b a, b = map(str, input().split()) map(str, input().split()) a c = float(a) float(a) c c = c * 380000.0 c * 380000.0 c s = 0 0 s s = c + s c + s s
n = int(input())
s = 0
for i in range(n):
  a, b = map(str, input().split())
  c = float(a)
  if b != "JPY":
    c = c * 380000.0
  s = c + s
print(s)