#include <bits/stdc++.h>

using namespace std;

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