A consistent framework for treating the energy dependence of fissionfragment neutron multiplicities is presented. The shape evolution of the compound nucleus towards scission is treated in the strong damping limit using the Metropolis walk method. The available excitation energy at scission is then divided statistically between the two fragments using microscopic level densities. Deformation energies, which contribute to the excitation energy when the fragments relax to their ground-state shapes, are also computed. From the total fragment excitation energies, the number of emitted neutrons is obtained and illustrated for neutron-induced fission of 235 U. * Presented at the XXV Nuclear Physics Workshop "Structure and dynamics of atomic nuclei", Kazimierz Dolny, Poland, September 25-30, 2018.(1) arXiv:1812.09208v2 [nucl-th]