Measurement of the energy dependence of the total photon-proton cross section at HERA