import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); int A1 = Integer.parseInt(inputs[0]); int A2 = Integer.parseInt(inputs[1]); int A3 = Integer.parseInt(inputs[2]); int max = Math.max(Math.max(A1, A2), A3); int counter = 0; if (isKadomatu(A1, A2, A3)) { System.out.println("INF"); } else { for (int i = 1; i <= max; i++) { if (isKadomatu(A1 % i, A2 % i, A3 % i)) { counter += 1; } } System.out.println(counter); } } private static boolean isKadomatu(int a, int b, int c) { if (a == b || b == c || c == a) { return false; } if (b < a && b < c) { return true; } else if (a < b && c < b) { return true; } else { return false; } } }