#include<bits/stdc++.h>
using namespace std;
int B,C;
int res;
int main(){
   ///Minimalan trud
   cin>>B>>C;
   if(B+C>=256){cout<<0<<endl;return 0;}
   res=1000;
   res=min(res,256-B);
   res=min(res,256-C);
   cout<<res<<endl;
   //cout<<max(0,256-B-C)<<endl;
   return 0;
}