I finally finished my course on Quantum Optics; in the book we used was a question about the “number of photons per unit volume excited in a cavity at temperature T” (Loudon, Quantum Theory of Light). After deriving a formula for this, you can show that the cosmic background radiation contains about 4-5*10^5 photons per litre.
I always got stuck at the same point, but now I finally know how to solve this.
Read the attached pdf if you want to know the solution.

