#include <iostream>
using namespace std ;
int B,C,x;
int main(){
cin>>B>>C;
x=max(B,C);
if (B<0 and C<0){
    cout<<"256"<<endl;
}
else if(x>=256 or (B+C)>=256){
    cout<<"0"<<endl;
}
else{
    cout<<256-x<<endl;
}
return 0;
}