using System; using System.Linq; class No358 { static void Main() { var num = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray(); string ans; var count = 0; if (num.Distinct().Count() < 3) ans = "0"; else if ((num[0] < num[1] && num[2] < num[1]) || (num[1] < num[0] && num[1] < num[2])) ans = "INF"; else { for (int i = num.Max(); i > 2; --i) { var temp = num.Select(x => x % i).ToArray(); if( (temp[0] < temp[1] && temp[2] < temp[1]&&temp[0] != temp[2])|| (temp[1] < temp[0] && temp[1] < temp[2] && temp[0] != temp[2]))count++; } ans = count.ToString(); } Console.WriteLine(ans); } }