#include #include bool judge(int a, int b, int c) { if (a == b || b == c || c == a) return false; if (a < b && b < c) return false; if (a > b && b > c) return false; return true; } void solve() { int a, b, c; std::cin >> a >> b >> c; if (judge(a, b, c)) { std::cout << "INF" << std::endl; return; } int ans = 0; for (int p = 1; p <= std::max({a, b, c}); ++p) { if (judge(a % p, b % p, c % p)) ++ans; } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }