import sys input = sys.stdin.buffer.readline a, b = map(int, input().split()) num = min(a.bit_length(), b.bit_length()) if a.bit_length() == b.bit_length(): num -= 1 print((1 << num) - 1)