Neutron production by cosmic-ray particles at sea level and underground