#include <bits/stdc++.h>
int main() {
  unsigned long long l, r;
  std::cin >> l >> r;
  unsigned long long ans = 0;
  unsigned long long cur = 0;
  unsigned long long oth = (1ull << 63) - 1;
  for (int i = 62; i >= 0; --i) {
    unsigned long long tmp = (1ull << i);
    if ((l <= cur && cur <= r) && (l <= oth && oth <= r)) {
      ans ^= tmp;
    } else {
      cur ^= tmp;
      oth ^= tmp;
      if ((l <= cur && cur <= r) && (l <= oth && oth <= r)) {
        ans ^= tmp;
      } else if (cur > r) {
        cur ^= tmp;
      } else {
        oth ^= tmp;
      }
    }
  }
  std::cout << ans << std::endl;
}
