using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            int B = int.Parse(x.Split(' ')[0]);
            int C = int.Parse(x.Split(' ')[1]);
            int A = 0;

            if (!(B + C >= 256))
            {
                if (B > C)
                    A = 256 - B;
                else
                    A = 256 - C;
            }

            Console.WriteLine(A);
        }
    }
}