#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int l, r;
  cin >> l >> r;
  long long int i, j, k;
  k = l ^ r;
  long long int p = 0;
  while (k) {
    p++;
    k = k >> 1;
  }
  long long int ans = 0, f = 1;
  while (p) {
    ans += f;
    f = (f << 1);
    p--;
  }
  cout << ans << endl;
}
