Quantization of the electron wave vector in nanostructures: Counting k-states