#include <bits/stdc++.h>
using namespace std;
int main() {
  long long left;
  long long right;
  scanf("%lld%lld", &left, &right);
  long long ans = 0LL;
  for (int i = (62); i >= (0); --i) {
    long long bitLeft = left & (1LL << i);
    long long bitRight = right & (1LL << i);
    if (bitRight && !bitLeft) {
      ans = (1LL << (i + 1)) - 1LL;
      printf("%lld\n", ans);
      return 0;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
