#include using namespace std; int a, b, c; bool ok(int mod) { int x = a % mod; int y = b % mod; int z = c % mod; if(x == y || y == z || z == x) { return false; } if(min({x, y, z}) == y || max({x, y, z}) == y) { return true; } else { return false; } } int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> a >> b >> c; if(a == b || b == c || c == a) { cout << 0 << endl; return 0; } if(min({a, b, c}) == b || max({a, b, c}) == b) { cout << "INF" << endl; return 0; } int ans = 0; for(int i = 1; i <= 1000; i++) { if(ok(i)) ans++; } cout << ans << endl; return 0; }