#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int A, B;
  cin >> A >> B;
  long long int num = 1;
  while (A / num != B / num) {
    num *= 2;
  }
  cout << num - 1 << "\n";
}
