using System;

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

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

            Console.WriteLine(A);
        }
    }
}