Inelastic Jψ production in deep inelastic scattering from hydrogen and deuterium and the gluon distribution of free nucleons