Perfect gift
시간 제한2초메모리 제한1024 MB
격자 위의 두 점이 이미 수놓아져 있을 때, 모서리 길이가 3칸 이상인 평행육면체의 테두리 위에 두 점이 놓이도록 채워야 하는 최소 십자수를 구한다.
문제
Taja prepares a present for the birthday. As you might know, the best present is the one handcrafted by yourself. Recently she learnt cross-stitching and decided to make use of this skill.
At home she only managed to find a canvas, which already had two crosses stitched on it. Don't panic --- you can always complement it to the full picture. She had little experience, that's why she chose simple but nevertheless beautiful picture, which is parallelepiped. She wants to finish the present as soon as possible, thus number of new cross-stitches should be the least possible.
Parallelepiped on the infinite grid is drawn like this.
Let's draw a rectangle with its upper left corner at and lower right corner at .

Then draw segments of equal length towards up-right from , and --- with ends at , , correspondingly. Then add segments and .

All edges of the parallelepiped should be at least cells long.
입력
First line of the input contains two integers and --- coordinates of the first cross-stitch. Second line contains coordinates of second cross: , . Coordinates of the first cross-stitches are different. Axis is directed from left to right, and axis --- from the bottom to the top. All numbers are within range .
출력
Output should contain single number --- the least amount of required cross-stitches.
힌트
This pictures correspond to the samples:
