Finite groups with 24 elements of maximal order