#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i >= 0; i--) #define all(v) v.begin(), v.end() #define mod1 1000000007 #define mod2 998244353 typedef long long ll; int main(){ ll A,B; cin >> A >> B; if (A > B) swap(A, B); ll allow_min = A; if (A == B) allow_min--; ll ans = 0; ll x = 1; while(true){ if (x - 1 > allow_min){ break; } ans = max(ans, x - 1); x *= 2; } cout << ans << endl; }