#include <iostream>
#include<algorithm>
using namespace std;

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

	return 0;
}