#include using namespace std; int main() { int A[3]; for(int i = 0; i < 3; i++) { cin >> A[i]; } int small = min({A[0], A[1], A[2]}); int big = max({A[0], A[1], A[2]}); if(count(A, A + 3, small) == 1 && count(A, A + 3, big) == 1) { if(A[1] == small || A[1] == big) { cout << "INF" << endl; } else { int ret = 0; for(int i = 1; i <= big; i++) { int M[3] = {A[0] % i, A[1] % i, A[2] % i}; int smaller = min({M[0], M[1], M[2]}); int bigger = max({M[0], M[1], M[2]}); if(count(M, M + 3, smaller) == 1 && count(M, M + 3, bigger) == 1) { if(M[1] == smaller || M[1] == bigger) ++ret; } } cout << ret << endl; } } else { cout << 0 << endl; } }