#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
	int B, C,A;
	cin >> B;
	cin >> C;
	if (B + C <= 256)
	{
		if (B>C)
		{
			A = 256 - B;
			if (B + 256) A = 1;
		}
		if (C > B) {
			A = 256 - C;
			if (C + 256) A = 1;
		}
	}
	else A = 0;


	cout << A;
	return 0;
}