Competitions

# Хвиля

# One knight

The hungry chess knight stays in the cell (`x`

, _{1}`y`

) of the chessboard of size _{1}**n** × **n**. He wants to get into the cell (`x`

, _{2}`y`

), where delicious chess grass grows. What is the least number of moves he has to do?_{2}

#### Input

Contains five numbers: **n**, `x`

, _{1}`y`

, _{1}`x`

, _{2}`y`

(_{2}**5** ≤ **n** ≤ **20**, **1** ≤ `x`

, _{1}`y`

, _{1}`x`

, _{2}`y`

≤ _{2}**n**). The upper left cell of the board has coordinates (**1**, **1**), the bottom right - (**n**, **n**).

#### Output

Print the minimum number of moves to go from (`x`

, _{1}`y`

) to (_{1}`x`

, _{2}`y`

)._{2}

Input example #1

5 1 1 3 1

Output example #1

2