a,b,c=map(int,input().split()) if a==b or b==c or a==c:print(0) elif max(a,b,c)==b or min(a,b,c)==b:print('INF') else:print(sum(1 for i in range(1,max(a,b,c)+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)))