#include <bits/stdc++.h>

using namespace std;

int main()
{
	int a = 0;
	int b, c;
	cin >> b;
	cin >> c;
	if (b + c >= 256)
	{
		a = 0;
	}
	else
	{
		int m = b > c ? b : c;
		a = 256-m;
	}
	cout << a;
	return 0;
}