#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int N = 1e5 + 5;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int l, r;
  cin >> l >> r;
  long long int d = (l ^ r);
  long long int idx = -1;
  for (long long int i = 63; i >= 0; i--) {
    if ((d >> i) & 1LL) {
      idx = i + 1;
      break;
    }
  }
  if (idx == -1) idx = 0;
  cout << (long long int)(1LL << idx) - 1 << '\n';
}
