using System;

namespace takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] unos = Console.ReadLine().Split();

            int B = int.Parse(unos[0]);
            int C = int.Parse(unos[1]);

            int A = 0;

            if (B > 255 || C > 255) A = 0;
            
            if (B + C < 256) {
                A = 256 - Math.Max(B, C);
            }

            Console.WriteLine(A);
        }
    }
}