Ab initio calculation of the superconducting transition temperature