This paper contains a complete computation of the homotopy ring of the spectrum of topological modular forms constructed by Hopkins and Miller. The computation is done away from $6$, and at the (interesting) primes $2$ and $3$ separately, and in each of the latter two cases, a sequence of algebraic Bockstein spectral sequences is used to compute the $E_2$ term of the elliptic Adams-Novikov spectral sequence from the elliptic curve Hopf algebroid. In a further step, all the differentials in the latter spectral sequence are determined. The result of this computation is originally due to Hopkins and Mahowald (unpublished).