#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { ll a, b; cin >> a >> b; ll c = max(a, b); ll d = min(a, b); if(c == 1) { cout << 0 << endl; return 0; } ll ans = 1; while(ans * 2 - 1 <= d) { ans *= 2; } if(c == d) { ans /= 2; } cout << ans - 1 << endl; return 0; }