#include <bits/stdc++.h>
using namespace std;
long long ans, a, b;
int main(int argc, char const *argv[]) {
  cin >> a >> b;
  for (long long i = 62; i >= 0; i--) {
    if (a <= (1ll << i) - 1ll && (1ll << i) <= b) {
      ans |= (1ll << i) - 1ll;
      ans |= (1ll << i);
      break;
    } else if ((1LL << i) <= a) {
      a -= (1LL << i);
      b -= (1LL << i);
    }
  }
  cout << ans << endl;
  return 0;
}
