#include<iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int xr = a^b;
int msbpos=0;
while(xr){
msbpos++;
xr = xr>>1;
}
int maxxr=0;
int x=1;
while(msbpos--){
maxxr+=x;
x = x<<1;
}
cout<<maxxr;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCl7CiAgICBpbnQgYSxiOwogICAgY2luPj5hPj5iOwogICAgaW50IHhyID0gYV5iOwogICAgaW50IG1zYnBvcz0wOwogICAgd2hpbGUoeHIpewogICAgICAgICBtc2Jwb3MrKzsKICAgICAgICAgeHIgPSB4cj4+MTsKICAgIH0KICAgIGludCBtYXh4cj0wOwogICAgaW50IHg9MTsKICAgIHdoaWxlKG1zYnBvcy0tKXsKICAgICAgICAgbWF4eHIrPXg7CiAgICAgICAgIHggPSB4PDwxOwogICAgfQoKICAgIGNvdXQ8PG1heHhyOwogICAgcmV0dXJuIDA7CiAgICAgCn0=