#include <iostream>
using namespace std;

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