using System;
					
public class Program
{
	public static void Main()
	{
	int x, y, z;
            x = int.Parse(Console.ReadLine());
            y = int.Parse(Console.ReadLine());
            if(x+y>=256)
            {
                z = 0;
            }
			else
			{
			 if(x>=y)
            {
                z = 256 - x;
            }
            else
            {
                z = 256 - y;
            }
			}
            Console.WriteLine(z);
	}
}