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

namespace ConsoleApp34
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = Convert.ToInt32(Console.ReadLine());
            int b = Convert.ToInt32(Console.ReadLine());
            int c = 0;

            if (a + b >= 256) 
            {
                c = 0;
                
            }

            else if(a < b)
            {
                c = 256 - b;
                
            }
            else if(b<a)
            {
                c = 256 - a;
            }
            Console.WriteLine(c);

        }
    }
}