using System;

namespace Minimalan_trud
{
    class Program
    {
        static void Main(string[] args)
        {
            string []p = Console.ReadLine().Split();
            int a, b, c;
            b = Convert.ToInt32(p[0]);
            c = Convert.ToInt32(p[1]);
            if (b + c < 256)
            {
                if (b > c)
                    a = 256 - b;
                else
                    a = 256 - c;
            }
            else
            {
                a = 0;
            }
            Console.WriteLine(a);
        }
    }
}