using System;
class Program
    {
        static void Main(string[] args)
        {
        int A = 0, B, C;
        string[] BC = Console.ReadLine().Split();
        B = Convert.ToInt32(BC[0]);
        C = Convert.ToInt32(BC[1]);
        if (B < 0 || B > 500)
            Console.WriteLine("B > 500 ili B < 0");
        if (C < 0 || C > 500)
            Console.WriteLine("C > 500 ili C < 0");
        if (B + C >= 256)
            A = 0;
        else if(B + C < 256)
        {
            if (B < C)
                A = 256 - C;
            else
                 A = 256 - B;
        }
        Console.WriteLine("{0}", A.ToString());
    }
}