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

namespace takmicenje1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, m;
            b = int.Parse(Console.ReadLine());
            c = int.Parse(Console.ReadLine());
            if (b + c >= 256)
                a = 0;
            else
            {
                if (b == 0 || c == 0)
                {
                    a = 256 - (b + c);
                    if (a < 0)
                        a = 0;
                }
                else
                {
                    m = b;
                    if (c > m)
                        m = c;
                    a = 256 - m;
                }   
            }
            Console.WriteLine(a);
            Console.ReadLine();
        }
    }
}