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