Estimation of the height of the first interaction in gamma-ray showers observed by Cherenkov telescopes