using System;

namespace kv1_z1
{
    class Program
    {
        static int brojbodova(int b, int c)
        {
            int max = b;
            if (c > max) max = c;
            if (max >= 265 || b + c >= 265) return 0;
            else return (256 - max);
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int b = int.Parse(s[0]);
            int c = int.Parse(s[1]);
            Console.WriteLine(brojbodova(b, c));
        }
    }
}