#line 1 "main.cpp" #include #include #include using namespace std; constexpr int X = 10000000; void solve() { int a, b, c; cin >> a >> b >> c; if (gcd(gcd(a, b), c) != 1) { cout << "INF\n"; return; } vector ok(X + 1, false); ok[0] = true; int ans = 0; for (int x = 0; x <= X; ++x) { if (ok[x]) { if (x + a <= X) ok[x + a] = true; if (x + b <= X) ok[x + b] = true; if (x + c <= X) ok[x + c] = true; } else { ++ans; } } cout << ans << "\n"; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }