Counting metastable states of Ising spin glasses on hypercubic lattices