Competitions

# October 9 - BMTK Programming School, High League

# The Segment

The segment's end points have integer coordinates. Find the number of points on a segment with integer coordinates.

#### Input

Four numbers - the coordinates `x`

, _{1}`y`

, _{1}`x`

, _{2}`y`

of the segment ends. All numbers are not greater than _{2}**2**۰`10`

by absolute value.^{9}

#### Output

Print the number of points on a segment with integer coordinates.

Input example #1

0 0 3 3

Output example #1

4