
Given a segment whose endpoints have integer coordinates, determine how many points with integer coordinates lie on this segment, including its endpoints.
Four integers x_1, y_1, x_2, y_2 — the coordinates of the segment's endpoints. All coordinates satisfy |x_1|, |y_1|, |x_2|, |y_2| \leq 2 \cdot 10^9.
Print the number of points with integer coordinates that lie on this segment.
Example 1
Example 2