#include<iostream>
using namespace std;
int main()
{
	int b, c;
	cin >> b >> c;
	int max = b;
	if (c > max)
	{
		max = c;
	}
	if (max >= 265)
	{
		cout << 0 << endl;
		return 0;
	}
	else
	{
		cout << 256 - max << endl;
	}
	return 0;
}