We introduce generic spatial modulation with a long period into a typical model of the Thouless pump, the Rice-Mele (RM) model, to examine the lattice analog of the fermion charge in quantum field theory. We derive a Diophantine equation between the fermion charge and the pumped charge, which leads to the one-dimensional (1D) analog of the Streda formula in the quantum Hall effect (QHE). Such a Streda formula tells that an adiabatic change of the period of the spatial modulation yields a spatial charge pump such that the rightmost charge is pumped to the right by the Chern number compared with the leftmost charge. This causes a change of the length of the fermion chain by an integer, giving the opportunity for direct measurement of the Streda formula in 1D systems.