Lattice Chern-Simons number without ultraviolet problems