using System; using System.Linq; class C2 { static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse); static void Main() => Console.WriteLine(Solve()); static object Solve() { var v = Read(); var (a, b, c) = (v[0], v[1], v[2]); if (Gcd(Gcd(a, b), c) > 1) return "INF"; var m = v.Max(); var u = new bool[m * m]; for (int k = 0; k < a; k++) for (int i = k * b; i < u.Length; i += a) u[i] = true; for (int k = 0; k < a; k++) for (int i = k * c; i < u.Length; i += a) u[i] = true; for (int k = 0; k < b; k++) for (int i = k * c; i < u.Length; i += b) u[i] = true; return u.Count(x => !x); } static int Gcd(int a, int b) { for (int r; (r = a % b) > 0; a = b, b = r) ; return b; } }