A photon counting estimates distribution of the average number of photons in coherent pulses