N = int(input())
x= [""]*(N+1)
u= [""]*(N+1)

for i in range(N):
  x[i],u[i] = input().split()

sum = 0
for i in range(N):
  sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0

  
print(sum) N = int(input()) N int(input()) int input() input x= [""]*(N+1) x [""]*(N+1) [""] "" N+1 N 1 u= [""]*(N+1) u [""]*(N+1) [""] "" N+1 N 1 for i in range(N):
  x[i],u[i] = input().split() i range(N) range N x[i],u[i] = input().split() x[i] x i input().split() ().split () input split u[i] u i sum = 0 sum 0 for i in range(N):
  sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0

   i range(N) range N sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0 sum float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0 u[i] == "JPY" u[i] u i "JPY" float(x[i]) float x[i] x i float(x[i])*380000.0 float(x[i]) float x[i] x i 380000.0 print(sum) print sum x= [""]*(N+1) [""]*(N+1) x N = int(input()) int(input()) N sum = 0 0 sum sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0 float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0 sum u= [""]*(N+1) [""]*(N+1) u
N = int(input())
x= [""]*(N+1)
u= [""]*(N+1)

for i in range(N):
  x[i],u[i] = input().split()

sum = 0
for i in range(N):
  sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0

  
print(sum)