#include <iostream>
using namespace std;

int max(int x, int y)
{
	if(x>y)
		return x;
	else if(x<y)
		return y;
	else
		return x;
}

int main()
{
	int a,b,c;
	cin>>b>>c;
	
	//prvi slucaj, B+C>=256, onda A=0
	if(b+c>=256)
	{
		a = 0;
		cout<<a;
	}
	//drugi slucaj, B+C<256, u tom slucaju a=256-max(b,c);
	if(b+c<256)
	{
		a = 256 - max(b,c);
		cout<<a;
	}
}