Let G be a finite group. It is proved that if, for every prime p, the number of nonidentity p-elements of G is divisible by the p'-part of |G|, then all element orders of G are prime powers.