eolymp
bolt
Try our new interface for solving problems
Problems

Polygonal chain - 2

Polygonal chain - 2

prb150 Find the number of different polygonal chains of minimum length, connecting the origin with the point M(x,y) so that its neighboring links are perpendicular to each other and have a unit length.

Input

Two integers - the coordinates of point М(x,y), -20x,y20.

Output

Print the number of possible polygonal chains of minimum length.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 2
Output example #1
2