using System;
namespace Prvi_zadatak
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] scanf = Console.ReadLine().Split();
            int b = int.Parse(scanf[0]);
            int c = int.Parse(scanf[1]);
            if (b + c >= 256)
            {
                Console.WriteLine(0);
            }
            else
            Console.WriteLine(Math.Max(Math.Max(256-Math.Max(c,b),Math.Min(c,b)),0));
        }
    }
}