#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); auto f = [&](int x[]) { auto [mi, ma] = minmax({x[0], x[1], x[2]}); return x[0] != x[1] && x[1] != x[2] && x[2] != x[0] && (x[1] == mi || x[1] == ma); }; int A[3]; rep(i,3) cin >> A[i]; if(f(A)) { cout << "INF" << endl; } else { int ans = 0; for(int p = 1; p <= 1000; p++) { int B[3]; rep(i,3) B[i] = A[i] % p; if(f(B)) ans++; } cout << ans << endl; } }