using System;

namespace minimalanTrud
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] unos = Console.ReadLine().Split();
            int b = int.Parse(unos[0]);
            int c = int.Parse(unos[1]);

            if (b >= 256 || c >= 256 || c + b >= 256) 
                Console.WriteLine(0); 
            else if (b > c) 
                Console.WriteLine(256 - b); 
 	    else
                Console.WriteLine(256 - c); 
        }
    }
}