N = int(input())
ans = 0

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

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