a, b = map(int, input().split()) if a < b: a, b = b, a print(min(2 ** (a.bit_length() - 1) - 1, b))