An elementary characterization of the orders of non-abelian groups