Finding the height of a ladder