def main(): A, B, C = map(int, input().split()) if A == C: print("0") # すでに成立している elif A > B and B < C: print("INF") # すでに成立している elif A < B and B > C: print("INF") else: print(count_kadomatsu(A, B, C)) def count_kadomatsu(a, b, c): max_val = max([a, b, c]) count = 0 for i in range(max_val): divider = i + 1 if check_kadomatsu(a % divider, b % divider, c % divider): count += 1 return count def check_kadomatsu(a, b, c): if a == b or b == c or c == a: return False elif a > b and b < c: return True elif a < b and b > c: return True else: False if __name__ == '__main__': main()