using System;

namespace Minimalan_trud
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int b = int.Parse(s[0]);
            int c = int.Parse(s[1]);
            int a = 0;
            int max = Math.Max(b, c);
            if (b + c >= 256 || b >= 256 || c >= 256)
                a = 0;
            else if (b == 0)
                a = 256 - c;
            else if (c == 0)
                a = 256 - b;
            else if (b == 0 && c == 0)
                a = 256;
            else
                a = 256 - max;
            Console.WriteLine(a);
        }
    }
}