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

namespace prvizadatak
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');

            long b = long.Parse(s[0]);
            long c = long.Parse(s[1]);
            long a = 0;
            if (b >= c) a = 256 - b;
            if (c >= b) a = 256 - c;
            if (b >= 256 || c >= 256 || b + c >= 256) a = 0;
            Console.WriteLine(a);

        }
    }
}