using System;

namespace PetljaTak
{
    class Program
    {
        
        static int min(int b, int c)
        {           
            
            int sum = 0;
            int veci = 0;
            if (b >= c) veci = b;
            else veci = c;
            sum = 256 - veci;
            if (sum < 0) return 0;
            else return sum;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            
            int b = int.Parse(s[0]);
            int c = int.Parse(s[1]);
            Console.WriteLine(min(b, c));



        }
    }
}