a1,a2,a3 = map(int,input().split()) if a1!=a3 and (a2a1 and a2>a3): print('INF') else: cnt=0 for i in range(3,1001): b1,b2,b3 = a1%i,a2%i,a3%i cnt += (b1!=b3 and ((b2b1 and b2>b3))) print(cnt)