Carrot Dreams
John works for a company called "FIELD-Tech," and today he was so exhausted after work that he fell asleep as soon as he got home. Unfortunately, even in his dreams, he can't escape thoughts of his job. In one dream, a company that grows carrots posed an unusual question to him: How many carrots grow on a non-zero segment connecting two given carrots? The ends of the segment (i.e., the two given carrots) should not be counted. This peculiar question was made even stranger by the company's representatives, who had carrots for heads, explaining that all the carrots grow on an infinite field, with exactly one carrot at each point with integer coordinates. You need to assist the weary John with this problem.
Input
You are given a single line containing four positive integers x1, y1, x2, y2, representing the coordinates of two carrots. (0 ≤ x1, y1, x2, y2 ≤ 50).
Output
Output a single line with the number of carrots that lie strictly on the segment connecting the two given carrots.