#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 (C > B) {
			A = 256 - C;
			
		}
	}
	else A = 0;


	cout << A;
	return 0;
}