Free energy of systems with several local minima by the acceptance ratio method