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

namespace TakProg1
{
    class Program
    {
        static void Main(string[] args)
        {
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            if (b + c >= 256)
                Console.WriteLine("0");
            else
                Console.WriteLine(256 - Math.Max(b, c));
        }
    }
}