#include <iostream>
//#include <iomanip>
//#include <cmath>
#include <algorithm>
//#include <string>
//#include <vector>
//#include <ctime>
//#include <cstdlib>
//#include <mycpp.h>

using namespace std;

int main()
{
	int a,b,c;
	cin>>b>>c;
	if(b+c>=256)
		a=0;
	else
		a=max(256-max(b,c),0);
	cout<<a;
}