problem-2-2

Julia has a sack full of red and yellow balls and wants to arrange them in a particular order as 

defined below.

Let us consider two definitions - 

Chroma-regularity - maximum number of objects of the same color that appear consecutively.

Min-Arrangement - An arrangement of the objects with minimum Chroma Regularity possible.

Given a sack full of only red and yellow balls find the required min-arrangement.

(Input – x and y one after the other and -1 or 0 to end

Output – one single integer)

SAMPLE INPUT
10
10

SAMPLE OUTPUT
1

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: