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

namespace Minimalan_trud
{
    class Program
    {
        static void Main(string[] args)
        {
            var d = Console.ReadLine().Split();
            int b = int.Parse(d[0]);
            int c = int.Parse(d[1]);
            int a;
            if (b + c >= 256)
            {
                a = 0;
            }
            else
            {
                if (b > c)
                {
                    a = 256 - b;
                }
                else
                {
                    a = 256 - c;
                }
            }
            Console.WriteLine(a);
        }
    }
}