#include<iostream>

using namespace std;

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