N = int(input())
ans = 0
b = 380000.0
for i in range(N):
  s = list(input().split())
  if s[1] == "JPY":
    ans += int(s[0])
  else:
    ans += float(s[0]) * b
print(ans) N = int(input()) N int(input()) int input() input ans = 0 ans 0 b = 380000.0 b 380000.0 for i in range(N):
  s = list(input().split())
  if s[1] == "JPY":
    ans += int(s[0])
  else:
    ans += float(s[0]) * b i range(N) range N s = list(input().split()) s list(input().split()) list input().split() ().split () input split if s[1] == "JPY":
    ans += int(s[0])
  else:
    ans += float(s[0]) * b s[1] == "JPY" s[1] s 1 "JPY" ans += int(s[0]) ans int(s[0]) int s[0] s 0 ans += float(s[0]) * b ans float(s[0]) * b float(s[0]) float s[0] s 0 b print(ans) print ans s = list(input().split()) list(input().split()) s N = int(input()) int(input()) N b = 380000.0 380000.0 b ans = 0 0 ans ans += float(s[0]) * b float(s[0]) * b ans ans += int(s[0]) int(s[0]) ans
N = int(input())
ans = 0
b = 380000.0
for i in range(N):
  s = list(input().split())
  if s[1] == "JPY":
    ans += int(s[0])
  else:
    ans += float(s[0]) * b
print(ans)