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

namespace ConsoleApplication74
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            a =int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());
            int max;
            if (b >= 256 || a >= 256)
            {
                Console.WriteLine(0);
            }
            else
            {
                if (a > b)
                {
                    max = a;
                    int razlika = 256 - max;
                    Console.WriteLine(razlika);
                }
                if (b > a)
                {
                    max = b;
                    int razlika = 256 - max;
                    Console.WriteLine(razlika);
                }
                Console.ReadKey();
            }     
        }
    }
}