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

namespace ConsoleApp27
{
    class Program
    {
        static void Main(string[] args)
        {
            int B = int.Parse(Console.ReadLine());
            int C = int.Parse(Console.ReadLine());
            int razlika = 256 - (B + C);

            if (razlika < 0|| razlika==0)
                Console.WriteLine(0);
            else if (razlika>0)
            {
                if (B > C)
                    Console.WriteLine(256 - B);
                else
                    Console.WriteLine(256 - C); 
                
            }
            
                


        }
    }
}