#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int a, b, c; cin >> a >> b >> c; if (a != b && b != c && c != a && (max({ a, b, c }) == b || min({ a, b, c }) == b)) { cout << "INF" << endl; } else { int ans = 0; for (int p = 1; p <= max({ a, b, c }); ++p) { int x = a % p, y = b % p, z = c % p; if (x != y && y != z && z != x && (max({ x, y, z }) == y || min({ x, y, z }) == y)) ++ans; } cout << ans << endl; } return 0; }