a, b = map(int, input().split()) print(int((len(bin(max(a, b))) - 3) * "1", 2))