using System;

namespace A1
{
    class Program
    {
        static int max(int a, int b)
        {
            int max1 = a;
            if (b > max1)
            {
                max1 = b;
            }
            return max1;
        }

        static void Main(string[] args)
        {
            int A = 0, U;
            string[] s = Console.ReadLine().Split();
            int B = int.Parse(s[0]);
            int C = int.Parse(s[1]);
            if (B + C < 256)
            {
                U = max(B, C);
                A = 256 - U;
            }
            if (B + C >= 256 || B >= 256 || C >= 256)
            {
                A = 0;

            }
            Console.WriteLine(A);
        }
    }
}