#include using namespace std; #define FOR(i, m, n) for(int i = m; i < n; i++) bool kdmtChk(int a, int b, int c) { if (a == b || b == c || c == a) return false; if (max({a, b, c}) == b || min({a, b, c}) == b) { return true; } else { return false; } } int main() { int a, b, c; cin >> a >> b >> c; if (kdmtChk(a, b, c)) { cout << "INF" << endl; return 0; } int ans = 0; FOR(i, 2, max({a, b, c}) + 1) { ans += kdmtChk(a % i, b % i, c % i); } cout << ans << endl; return 0; }