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

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