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