#include<string>
#include<algorithm>
#include<iostream>

using namespace std;

int main()
{
	int B, C;
	cin >> B >> C;
	int a=0;

	if (B+C>=256)
	{
		a = 0;
	}
	else if(B>C)
	{
		a = 256 - B;
	}
	else if (C>B)
	{
		a = 256 - C;
	}

	cout << a;

	return 0;
}