The knight jumps either 2 squares vertically and 1 horizontally, or 2 squares horizontally and 1 vertically, as shown in the picture. What is the minimum number of moves the knight needs in order to go from square a8 to the square h1?