#include using namespace std; #define rep(i,a,b) for(int i=a;i vi; bool check(vi _a, int p) { vi a(3); rep(i, 0, 3) a[i] = _a[i] % p; //rep(i, 0, 3) cout << a[i] << " "; //cout << endl; if (a[0] == a[1]) return false; if (a[0] == a[2]) return false; if (a[1] == a[2]) return false; int _max = max(a[0], max(a[1], a[2])); int _min = min(a[0], min(a[1], a[2])); if (_max == a[1]) return true; if (_min == a[1]) return true; return false; } int main() { vi a(3); rep(i, 0, 3) cin >> a[i]; int m = 0; rep(i, 0, 3) m = max(m, a[i]); int c = 0; rep(i, 1, m + 1) if (check(a, i)) c++; if (check(a, m + 1)) cout << "INF" << endl; else cout << c << endl; }