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