a, b = map(int, input().split()) if a > b: a, b = b, a x = 1 while 2 * x <= a: x *= 2 if 2 * x <= b: print(a) else: print(x - 1)