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

namespace minimalan_trud
{
    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;
            else
            {
                int t = Math.Max(B, C);
                A = 256 - t;
            }
            Console.WriteLine(A);
        }
    }
}