A little girl loves problems on bitwise operations very much. Here's one of them.

You are given two integers *l* and *r*. Let's consider the values of <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/9b77fab607849cb208cd8aab633b62d894fc3358.png" style="max-width: 100.0%;max-height: 100.0%;"/> for all pairs of integers *a* and *b* (*l* ≤ *a* ≤ *b* ≤ *r*). Your task is to find the maximum value among all considered ones.

Expression <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/b364f2e04c665b78b924ec10666327a4ef4635bc.png" style="max-width: 100.0%;max-height: 100.0%;"/> means applying bitwise excluding or operation to integers *x* and *y*. The given operation exists in all modern programming languages, for example, in languages *C*++ and *Java* it is represented as "^", in *Pascal* — as "xor".
The single line contains space-separated integers *l* and *r* (1 ≤ *l* ≤ *r* ≤ 10<sup class="upper-index">18</sup>).

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier.
from collections import Counter, deque
from functools import lru_cache
# from itertools import combinations
import bisect
import heapq
from itertools import permutations, product
import math
from operator import le
from re import S, T
import sys
from turtle import left, right
from types import GeneratorType

# sys.stdin = open('grey.in', 'r')
# sys.setrecursionlimit(5 * 10**5)


def bootstrap(f, stack=[]):
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to
 
    return wrappedfunc
 
result = []


input = sys.stdin.readline

LOG = 18

array = [1, 2, 3, 4, 5, 6, 7, 8]



def genSparseTable(array):
        
    sparseTable = [[float('inf') for i in range(LOG)] for x in range(len(array))]


    for i in range(len(array)):
        sparseTable[i][0] = array[i]



    for i in range(1, LOG):
        j = 0
        while((j + (1 << i) - 1) < len(array)):
            sparseTable[j][i] = max(sparseTable[j][i - 1], sparseTable[j + (1 << (i  - 1))][i - 1])
            j += 1

    return sparseTable

def query(l, r, sparseTable):
    length = (r - l) + 1
    idx = int(math.log(length, 2))
    return max(sparseTable[l][idx], sparseTable[r - (1 << idx) + 1][idx])





def calc(numOne, numTwo):
    
    currentSum = 0
    for i in range(32):
        firstBit, secondBit = min(1, numOne & (1 << i)), min(1, numTwo & (1 << i))
        
        currentSum += (firstBit ^ secondBit)

    return currentSum    


# counter = Counter()
# for i in range(0, 119000):
#     counter[calc(i, i + 1)] += 1


# print(counter)



 
input = sys.stdin.readline
 
# def bootstrap(f, stack=[]):
#     def wrappedfunc(*args, **kwargs):
#         if stack:
#             return f(*args, **kwargs)
#         else:
#             to = f(*args, **kwargs)
#             while True:
#                 if type(to) is GeneratorType:
#                     stack.append(to)
#                     to = next(to)
#                 else:
#                     stack.pop()
#                     if not stack:
#                         break
#                     to = stack[-1].send(to)
#             return to
 
#     return wrappedfunc
 

# t = int(input())
# result = []
# for _ in range(t):
#     a, b = map(int, input().split())


#     def solve():
#         state = False
#         count = 0
        
#         currentMin = float('inf')
#         for z in range(0, b + 5):
#             currentB = b + z
#             count = 0
#             for i in range(32):
#                 firstBit, secondBit = a & (1 << i), currentB & (1 << i)

#                 if secondBit and not firstBit:
#                     state = True
#                     continue

#                 if firstBit and not secondBit:
#                     count += (2**i)
#             currentMin = min(currentMin, count + 1 + z if state else count + z)        
#         return min(currentMin, b - a)

#     print(solve())           

# # print(result)



class SegmentTree2D:

    
    def __init__(self, row, col, inMatrix):
        self.rows = row
        self.cols = col
        self.inMatrix = inMatrix
        self.matrix = [[0 for z in range(col + 1)] for i in range(row + 1)]
        self.genTable()


    

    def genTable(self):
        self.matrix[0][0] = 0


        for row in range(self.rows):
            currentSum = 0
            for col in range(self.cols):
                currentSum += self.inMatrix[row][col]
                above = self.matrix[row][col + 1]
                self.matrix[row + 1][col + 1] = currentSum + above

    


    def sumRegion(self, rowOne, colOne, rowTwo, colTwo):
        rowOne += 1
        rowTwo += 1
        colOne += 1
        colTwo += 1

        bottomRight, above = self.matrix[rowTwo][colTwo], self.matrix[rowOne - 1][colTwo]
        left, topLeft = self.matrix[rowTwo][colOne - 1], self.matrix[rowOne - 1][colOne - 1]
        return bottomRight - above - left + topLeft








def power(a, b, mod):
    if not b:
        return 1

    temp = power(a, b // 2, mod)
    result = temp * temp if b % 2 == 0 else temp * temp * a
    result %= mod
    return result    











left, right = map(int, input().split())



def solve():
    if left == right:
        return 0

    if left == right - 1:
        return left ^ right


    mostSignificantBit = None
    for i in reversed(range(65)):
        firstBit, secondBit = min(left & (1 << i), 1), min(right & (1 << i), 1)
        if firstBit != secondBit:
            mostSignificantBit = i
            break

    ans = 0


    # print(mostSignificantBit)

    for i in range(mostSignificantBit + 1):
        ans ^= (1 << i)


    return ans        
    

print(solve())              



