using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int B = Convert.ToInt16(s[0]);
            int C = Convert.ToInt16(s[1]);
            int X=0;
            if ((B + C) >= 256) X = 0;
            else
            {
                if (B > C) X = 256 - B;
                else X = 256 - C;
            }
            Console.WriteLine(X);
        }
    }
}