The time evolution of a system of coagulating particles under the product kernel and arbitrary initial conditions is studied. Using the improved Marcus-Lushnikov approach, the master equation is solved for the probability to find the system in a given mass spectrum , with being the number of particles of size . The exact expression for the average number of particles at arbitrary time is derived and its validity is confirmed in numerical simulations of several selected initial mass spectra.