#include <bits/stdc++.h>
using namespace std;
int a,b;
int main(){
cin>>a>>b;

if(a+b==256)
cout<<0;
else if(a+b<256)
    cout<<256-max(a,b);
else if(a>256 and b<256)
    cout<<0;
else if(a<256 and b>256)
    cout<<0;
else if(a>256 and b>256)
    cout<<0;

return 0;

}