#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r;
  while (cin >> l >> r) {
    long long ans = 0, cnt = 0;
    for (long long x = l ^ r; x; x >>= 1) ++cnt;
    for (int i = 0; i < (cnt); i++) ans |= 1ll << i;
    cout << ans << endl;
  }
  return 0;
}
