#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b;
  cin >> a >> b;
  long long int c = a ^ b;
  long long int x = 1;
  while (x <= c) {
    x = x << 1;
  }
  cout << x - 1 << endl;
  return 0;
}
