#include <iostream>
using namespace std;
int main(){
	
	int A,B,C;
	cin>>B>>C;
	int g= C+B;
	
	 if(256<=g){	
	A=0;
	cout<<A;
	 }
     else if(256-B<256-C){
			A=256-B;
			cout<<A;
		}else {
			A=256-C;
			cout<<A;
		}
		cout<<endl;
	system("PAUSE");
	return 0;
}