Rabbit`s planet
The planet where rabbits live is not much different from ours. It has wonderful nature. It is the third planet from Rabbitus Beta Megastar. Biggest difference is that rabbit’s planet has a shape of cube with side R. This is strange. But rabbits like it, since at their opinion it simplifies navigation at the planet.
You need to check how easier it is to live at cubic planet. Try to calculate the shortest distance between 2 points at the planet like this.
Input
The only line at the input contains seven integers, separated by spaces: R, x_1, y_1, z_1, x_2, y_2, z_{2 }(1 ≤ R ≤ 100000, 0 ≤ x_1,y_1, z_1, x_2, y_2, z_2 ≤ R) – correspondingly, side of the cube and coordinates of points. Two opposite vertexes of the cube are located at points (0, 0, 0) and (R, R, R), all sides are parallel to the coordinate axis. All points at input belong to cube’s surface.
Output
You need to output one number – distance between specified points going by planet's surface, rounded to closest integer.