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