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

namespace Takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            int A, B, C;
            string[] a = Console.ReadLine().Split();
            B = int.Parse(a[0]);
            C = int.Parse(a[1]);
            if (B >= 0 && B <= 500 && C >= 0 && C <= 500)
            {
                if (B > C)
                {
                    A = 256 - B;
                }
                else
                {
                    A = 256 - C;
                }
                if (B >= 256 || C >= 256)
                {
                    A = 0;
                }
                if (B == 0 && C == 0)
                {
                    A = 256;
                }
                Console.WriteLine(A);
            }
            Console.ReadLine();

        }
    }
}