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