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