using System;

class MainClass {
  public static void Main (string[] args) {
    int b = Convert.ToInt32(Console.ReadLine());
    int c = Convert.ToInt32(Console.ReadLine());
    if (b + c >= 256)
    {
      Console.WriteLine("0");
    }
    else if (b > c)
    {
      Console.WriteLine(256 - b);
    }
    else Console.WriteLine(256 - c);
  }
}