A,B,C=map(int,input().split()) ans=0 if A==B or B==C or C==A: print(0) exit() elif B==min(A,B,C) or B==max(A,B,C): print("INF") exit() else: for i in range(1,max(A,B,C)+1): a=A%i b=B%i c=C%i if b>a>c or b>c>a or a>c>b or c>a>b: ans+=1 #print(a,b,c,i) print(ans)