The Segment#136

The Segment

1 second
128 megabytes
Very easy

Given a segment whose endpoints have integer coordinates, determine how many points with integer coordinates lie on this segment, including its endpoints.

Input

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.

Output

Print the number of points with integer coordinates that lie on this segment.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading