using System;

namespace zadatak1
{
    class Program
    {
        static void Main(string[] args)
        {
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
           int x=0, max = 0;

            if(b>c)
            {
                max = b;
                x = 256 - b;
            }
            else
            {
                max = c;
                x = 256 - c;
            }
            if(max<256)
            Console.WriteLine(x);
            else
            Console.WriteLine("0");
        }
    }
}