#include #include using namespace std; int main(int argc, const char* argv[]) { int A[3]; cin >> A[0] >> A[1] >> A[2]; { int _A[3] = {A[0], A[1], A[2]}; sort(&_A[0], &_A[2 + 1]); if (_A[0] == _A[1]) { cout << 0 << endl; return 0; } } if (A[1] < A[0] && A[1] < A[2] || A[1] > A[0] && A[1] > A[2]) { cout << "INF" << endl; return 0; } int cnt = 0; int p = 1; while (p <= 1001) { if (A[0] % p != A[1] % p && A[0] % p != A[2] % p && (A[1] % p < A[0] % p && A[1] % p < A[2] % p || A[1] % p > A[0] % p && A[1] % p > A[2] % p)) { cnt++; } p++; } cout << cnt << endl; return 0; }