#include <iostream>

int main(int argc, char** argv) {
	
	int dr,tr;
	
	cin>>dr;
	cin>>tr;
	
	if(dr+tr>=256){
		
		cout<<0;
	}
	else{
		if(dr>=tr){
			
			cout<<256-dr;		
		}
		else{
				
			cout<<256-tr;
		}
	}
	
	
	return 0;
}