n = int(input())
ans = 0
for i in range(n):
  x, u = map(str, input().split())
  if u == 'JPY':
    ans += int(x)
  elif u == 'BTC':
    ans += 380000.0 * float(x)
print(ans) n = int(input()) n int(input()) int input() input ans = 0 ans 0 for i in range(n):
  x, u = map(str, input().split())
  if u == 'JPY':
    ans += int(x)
  elif u == 'BTC':
    ans += 380000.0 * float(x) i range(n) range n x, u = map(str, input().split()) x map(str, input().split()) map str input().split() ().split () input split u if u == 'JPY':
    ans += int(x)
  elif u == 'BTC':
    ans += 380000.0 * float(x) u == 'JPY' u 'JPY' ans += int(x) ans int(x) int x elif u == 'BTC':
    ans += 380000.0 * float(x) u == 'BTC' u 'BTC' ans += 380000.0 * float(x) ans 380000.0 * float(x) 380000.0 float(x) float x print(ans) print ans n = int(input()) int(input()) n ans = 0 0 ans ans += int(x) int(x) ans x, u = map(str, input().split()) map(str, input().split()) x ans += 380000.0 * float(x) 380000.0 * float(x) ans u = map(str, input().split()) map(str, input().split()) u
n = int(input())
ans = 0
for i in range(n):
  x, u = map(str, input().split())
  if u == 'JPY':
    ans += int(x)
  elif u == 'BTC':
    ans += 380000.0 * float(x)
print(ans)