using System;
using System.IO;

namespace feladat1
{
	class Program
	{
		public static void Main(string[] args)
		{
			string input = Console.ReadLine();
			string[] inputT = input.Split(' ');
			int b = Convert.ToInt32(inputT[0]);
			int c = Convert.ToInt32(inputT[1]);
    
        if(b+c > 256){
            Console.WriteLine(0);
        }else{
            int min = 256-b;
            if(min>256-c){
                min = 256-c;
            }
            Console.WriteLine(min);
        }
			
		}
	}
}