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
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
r=input()
s=input()
m=min(r,s)
n=max(r,s)
if m==n or s==1:
	print "1"
else:
	while m>0:
		n=n/2+1
		m-=1
	print n