#include <stdio.h>

int maks(int a,int b){
	if(a>b)
		return a;
	else
		return b;
}

int main(){

	int b,c,a;
	scanf("%d%d",&b,&c);
	
	if((b<0 || c<0) || (b>500 || c>500))
		return 1;
			
	if(b+c < 256)
	{
		int s = maks(b,c);
		a = 256 - s;
	
	}
	else
		a = 0;
		
	printf("%d",a);
	return 0;
	
}