Phase estimation by photon counting measurements in the output of a linear Mach–Zehnder interferometer