#include using namespace std; int main() { long long a, b; cin >> a >> b; long long ans = 0; while (ans * 2 + 1 <= min(a, b)) { ans = ans * 2 + 1; } cout << ans << endl; return 0; }