A,B=map(int,input().split()) print(min((1<<(len(bin(max(A,B)))-3))-1,A,B))