a,b,c=map(int,input().split()) d=max(a,b,c) e=min(a,b,c) p=print if d!=b or e!=b:p(0) elif d==b or e==b:p('INF') else:p(sum(1 for i in range(1,d+1)if(a%i!=b%i and b%i!=c%i and a%i!=c%i)and(max(a%i,b%i,c%i)==b%i or min(a%i,b%i,c%i)==b%i)))