import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A[] = new int[3], B[] = new int[3], ans = 0, minA = Integer.MAX_VALUE, maxA = Integer.MIN_VALUE, minB, maxB; for (int i = 0; i < 3; ++i) { A[i] = sc.nextInt(); minA = Math.min(minA, A[i]); maxA = Math.max(maxA, A[i]); } sc.close(); if (A[0] != A[1] && A[1] != A[2] && A[0] != A[2] && (A[1] == minA || A[1] == maxA)) System.out.print("INF"); else { for (int i = 1; i <= maxA; ++i) { minB = Integer.MAX_VALUE; maxB = Integer.MIN_VALUE; for (int j = 0; j < 3; ++j) { B[j] = A[j] % i; minB = Math.min(minB, B[j]); maxB = Math.max(maxB, B[j]); } if (B[0] != B[1] && B[1] != B[2] && B[0] != B[2] && (B[1] == minB || B[1] == maxB)) ++ans; } System.out.print(ans); } } }