import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long a1 = sc.nextInt(); long a2 = sc.nextInt(); long a3 = sc.nextInt(); long Max=Math.max(Math.max(a1,a2),a3); int count =0; if(kado(a1,a2,a3)){ System.out.println("INF"); }else{ for(int i=1;i<=Max;i++){ long b1=a1%i; long b2=a2%i; long b3=a3%i; if(kado(b1,b2,b3)){ count++; } } System.out.println(count); } } public static boolean kado(long x,long y,long z){ return ((x!=y)&&(y!=z)&&(z!=x))&&(((y>x)&&(y>z))||((y