#include<iostream>
#include<cmath>
using namespace std;
main()
{
	int a, b, c;
	cin >> b >> c;
	if(b > 255 || c > 255)
		a = 0;
	else
	{
		if(b > c)
		{
			a = 256 - b;
		}
		else
		a = 256 - c; 
	}
	cout << a;
	return 0;
}