using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static void Main() { int[] A = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); if (A[0] == A[1] || A[0] == A[2]||A[1]==A[2]) { Console.WriteLine(0); return; } if (A.Min() == A[1]||A.Max()==A[1]) { Console.WriteLine("INF"); return; } int max = A.Max(); int cnt = 0; for(int i = 3; i <= max; i++) { if (Kadomatsu(A[0] % i, A[1] % i, A[2] % i)) { cnt++; } } Console.WriteLine(cnt); } static bool Kadomatsu(params int[] A) { if(A[0] == A[1] || A[0] == A[2] || A[1] == A[2]) { return false; } if (A.Min() == A[1] || A.Max() == A[1]) { return true; } return false; } }