import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) INF = 2 ** 63 - 1 mod = 998244353 a, b = mi() ans = 0 for i in range(0, 33): if a >= 2 ** i or b >= 2 ** i: ans = 2 ** i - 1 print(ans)