using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
    static void Main(string[] args)
    {
        int A, B, C;
        string[] spl = Console.ReadLine().Split(' ');
        B = int.Parse(spl[0]);
        C = int.Parse(spl[1]);
        if (B + C >= 256)
        {
            Console.WriteLine(0);
            return;
        }
        bool BgrC = B > C;
        if (BgrC) A = 256 - B;
        else A = 256 - C;
        Console.WriteLine(A);
    }
}