Photon statistics measurement by use of single photon detection