A measurement of the A-dependence of the J/ψ cross section by comparing data on hydrogen and tungsten targets at 39.5 GeV/c