Explicit solution of the mean spherical model for ions and dipoles