using System;

namespace Minimalni_trud
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] x = Console.ReadLine().Split();
            int B = int.Parse(x[0]);
            int C = int.Parse(x[1]);
            int A;
            if(B+C>=256)
            {
                A = 0;
            }
            else if(B>C)
            {
                A = 256 - B;
            }
            else
            {
                A = 256 - C;
            }
            Console.WriteLine(A);
        }
    }
}