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

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


        }
    }
}