using System; namespace No773_contest { class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(' '); int a = int.Parse(input[0]); int b = int.Parse(input[1]); int day = 0; if (a <= 25 && a > 23) day += a - 23; else if (b >= 23 && b < 25) day += 25 - b; else if (a > 25 || b < 23) day = 3; Console.WriteLine(day); } } }