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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string [] s = Console.ReadLine().Split();
            int n, m;
            n = int.Parse(s[0]);
            m = int.Parse(s[1]);
            if ((m + n) >= 256)
                Console.WriteLine(0);
            else if ((m + n) < 256)
            {
                if (m > n)
                    Console.WriteLine(256 - m);
                else
                    Console.WriteLine(256 - n);
            }
        }
    }
}