How many sun-like stars are there in the universe? After yesterday's announcement of the Kepler telescope finding a huge amount of newly observed exoplanets, i saw a headline claiming that as much as 22% of sun like stars in the universe have planets in their habitable zone. There are loads of stars in the universe, so the number of planets in the habitable zone has to be enourmous. But how many of the stars in the universe are about the same size as our sun?
This is a question that concerns the initial mass function (IMF) - an empirical (that is, defined by observations rather than theory) function that describes the statistical distribution of stellar masses.

Edwin Salpeter (1955) was the first to describe the IMF, though if you read Chabrier (2003) there are some reasonably comprehensive explanations of the theory and history. However, these lecture notes are a fair bit more accessible.

From the approximations in the UCSC lecture notes I linked above, I get that around 4% of stars are between 0.7 and 1.3 solar masses (92% are between 0.1 and 0.7 solar masses!).

There are perhaps 100 billion stars in a galaxy and 100 billion galaxies in the observable universe, giving something on the order of $4\times 10^{20}$ (400 billion billion) stars that are about ($\pm 30\%$) one solar mass.