#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 < d) { ans *= 2; } if(ans - 1 == d) { cout << ans - 1 << endl; return 0; } ans /= 2; cout << max(ans - 1, (ll)1) << endl; return 0; }