#include using namespace std; int main(){ int A, B; cin >> A >> B; assert(1 <= A && A <= (int)1e9); assert(1 <= B && B <= (int)1e9); if(A < B)swap(A, B); int bit = 1; while(bit * 2 <= A)bit *= 2; cout << min(bit - 1, B) << endl; }