N = int(input())
a = 0

for n in range(N):
  x,u = input().split()
  
  if u=="JPY":
    a+=int(x)
  else:
    a+=380000*float(x)

print(a) N = int(input()) N int(input()) int input() input a = 0 a 0 for n in range(N):
  x,u = input().split()
  
  if u=="JPY":
    a+=int(x)
  else:
    a+=380000*float(x) n range(N) range N x,u = input().split() x input().split() ().split () input split u if u=="JPY":
    a+=int(x)
  else:
    a+=380000*float(x) u=="JPY" u "JPY" a+=int(x) a int(x) int x a+=380000*float(x) a 380000*float(x) 380000 float(x) float x print(a) print a x,u = input().split() input().split() x a+=int(x) int(x) a N = int(input()) int(input()) N u = input().split() input().split() u a+=380000*float(x) 380000*float(x) a a = 0 0 a
N = int(input())
a = 0

for n in range(N):
  x,u = input().split()
  
  if u=="JPY":
    a+=int(x)
  else:
    a+=380000*float(x)

print(a)