using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray(); if(IsKadomatsu(inpt[0], inpt[1], inpt[2])) { Console.WriteLine("INF"); return; } if(inpt[0] == inpt[1] || inpt[0] == inpt[2] || inpt[1] == inpt[2]) { Console.WriteLine("0"); return; } long ans = 0; for(int i=2; i<=inpt.Max(a=>a); i++) { if(this.IsKadomatsu(inpt[0] % i, inpt[1] % i, inpt[2] % i)) { ans++; } } Console.WriteLine(ans); } private bool IsKadomatsu(int numA, int numB, int numC) { if(numA == numB || numA == numC || numB == numC) { return false; } if(numA < numB && numC < numB) { return true; } if(numA > numB && numC > numB) { return true; } return false; } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 114 514 114 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }