#include <bits/stdc++.h>

using namespace std;

int main()
{
	int B, C;
	cin >> B >> C;
	if (B + C >=256)
	{
		cout << 0 << endl;
	}
	else
	{
		if (C == 0)
		{
			cout << 256 - B << endl;
		}
		else
		{
			if (B > C)
			{
				cout << 256 - B << endl;
			}
			else
			{
				cout << 256 - C << endl;
			}
		}
	}
	return 0;
}