Measurement of the total neutron cross section of 14N and 24Mg