There are at most two prime numbers dividing $|G|$ Need just hints

Let $G$ is a finite non-abelian group such that all its proper subgroups are abelian. Then there are  at most two different prime numbers dividing $|G|$.

I found some ideas about such this group here, https://mathoverflow.net/questions/25307/groups-with-all-subgroups-normal, but honestly don’t know much about Dedekind groups. Thanks.
 A: Hard part: Show that $G$ cannot be simple. One way to do is to apply a certain fact about maximal subgroups, which is good to know. If in a finite non-abelian group intersections of distinct maximal subgroups are trivial, then the group cannot be simple. Thus it is enough for you to show that if $G$ is simple, then intersections of distinct maximal subgroups of $G$ are trivial.
After that, show that $G$ must be solvable.
If $G$ is solvable, it has a normal subgroup $N$ of prime index, say $[G:N] = p$. Since $N$ is abelian, it has all Sylow subgroups normal. Thus $G$ has all Sylow subgroups normal with the possible exception of $p$-Sylow subgroups.
If $G$ has more than two prime factors, you can prove that the $p$-Sylow subgroup is normal as well. But this it not possible, because then $G$ would be abelian. 

I'm leaving a lot of details out, but I believe this approach should work. This theorem is similar to a different one:

If $G$ is a finite non-nilpotent group with all proper subgroups nilpotent, then $|G| = p^a q^b$ for distinct primes $p$ and $q$.

A proof can be found in Derek Robinson's group theory book, and I'm basically using the same idea here.
A: @Babak, you should also study a classic paper (1903) of Miller and Moreno. George Miller was a very prolific group theorist, however he did not dispose of our modern notation. So do not be scared off by the style.
