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

namespace ConsoleApplication1
{
    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 a = 0;
            if (b + c >= 256)
                a = 0;
            if (b + c < 256 && b <= c)
                a = 256 - c;
            if (b + c < 256 && c < b)
                a = 256 - b;
            Console.WriteLine(a);
        }
    }
}