import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b, c, cnt = 0; a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); if (a == b || b == c || c == a) { System.out.println(0); return; } if (Math.max(Math.max(a, b), c) == b || Math.min(Math.min(a, b), c) == b) { System.out.println("INF"); return; } int ta, tb, tc; for (int i = 3, j = Math.max(a, c); i <= j; i++) { ta = a % i; tb = b % i; tc = c % i; if (ta == tb || tb == tc || tc == ta) { continue; } if (Math.max(Math.max(ta, tb), tc) == tb || Math.min(Math.min(ta, tb), tc) == tb) { cnt++; } } System.out.println(cnt); } }