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

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int B = int.Parse(s[0]);
            int C = int.Parse(s[1]);
            int zbir = C + B;
            int A;
            if ((B >= 256) || (C >= 256))
            {
                A = 0;
                Console.WriteLine(A);
            }
            else if (zbir > 256)
            {
                A = 0;
                Console.WriteLine(A);
            }
            else if ((B > C) && (zbir == 256))
            {
                A = 0;
                Console.WriteLine(A);
            }
            else if ((C > B) && (zbir == 256))
            {
                A = 0;
                Console.WriteLine(A);
            }
            else if ((B > C) && (zbir < 256))
            {
                A = 256 - B;
                Console.WriteLine(A);
            }
            else if ((C > B) && (zbir < 256))
            {
                A = 256 - C;
                Console.WriteLine(A);
            }
            else if ((B > C) && (B < 256))
            {
                A = 256 - B;
                Console.WriteLine(A);
            }
            else if ((C > B) && (C < 256))
            {
                A = 256 - C;
                Console.WriteLine(A);
            }
            else if ((C == B) && (zbir < 256))
            {
                A = 256 - B;
                Console.WriteLine(A);
            }
            else
            {
                A = 0;
                Console.WriteLine(A);
            }

        }
    }
}