using System;

namespace ConsoleApp29
{
    class Program
    {
        static int veci(int a, int b)
        {
            if (a >= b)
                return a;
            else
                return b;
        }
        static void Main(string[] args)
        {
            int a = 0, b, c, m, v;
            string[] s = Console.ReadLine().Split();
            b = int.Parse(s[0]);
            c = int.Parse(s[1]);
            v = veci(b, c);
            m = b + c - v;
            while (v + a < 256)
            {
                a++;
            }
            if (a <= m)
                Console.WriteLine(0);
            else
                Console.WriteLine(a);
        }
    }
}