using System;

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