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

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