#include using namespace std; bool isKadomatsu(long long x, long long y, long long z) { if (x == y || y == z || x == z) return false; if (x > y && y < z) return true; if (x < y && y > z) return true; return false; } int main() { int a, b, c; cin >> a >> b >> c; int ans = 0; for (int i = 1; i <= 1000000; i++) { if (isKadomatsu(a % i, b % i, c % i)) ans++; } if (ans >= 10000) { cout << "INF" << endl; } else { cout << ans << endl; } }