#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long l, r, x = 1, ans = 0;
  cin >> l >> r;
  for (int i = (63); i >= (0); i--)
    if ((l & (x << i)) != (r & (x << i))) {
      ans = ((x << (i + 1)) - 1);
      break;
    }
  cout << ans << endl;
  return 0;
}
