a, b, c = map(int, input().split()) if a == b or b == c or a == c: print(0) elif a < b > c or a > b < c: print('INF') else: x = max(a, b, c) y = 0 for i in range(1, x+1): if (a%i < b%i > c%i or a%i > b%i < c%i) and a%i != c%i: print(a%i, b%i, c%i) y += 1 print(y)