One knight#997

One knight

1 second
128 megabytes
Medium

On a chessboard of size n \times n, a hungry chess knight is standing at cell (x_1, y_1). He wants to reach cell (x_2, y_2), where delicious chess grass grows. What is the minimum number of moves he must make to get there?

Input

Contains five numbers: , x_1, y_1, x_2, y_2 (5 \leq n \leq 20, 1 \leq x_1, y_1, x_2, y_2 \leq n). The upper left cell of the board has coordinates , and the lower right cell has coordinates .

Output

Print the minimum number of moves required to go from (x_1, y_1) to (x_2, y_2).

Examples

Example 1

Loading
Loading