#include using namespace std; #define GET_MACRO(a, b, c, d, NAME, ...) NAME #define REP(...) GET_MACRO(__VA_ARGS__, REP_4, REP_3, REP_2, REP_1)(__VA_ARGS__) #define REP_1(n) REP_2(i_, n) #define REP_2(i, n) REP_3(i, 0, n) #define REP_3(i, a, b) REP_4(i, a, b, 1) #define REP_4(i, a, b, s) for (LL i = (a); i < (LL)(b); i += (LL)(s)) #define RREP(...) GET_MACRO(__VA_ARGS__, RREP_4, RREP_3, RREP_2, RREP_1)(__VA_ARGS__) #define RREP_1(n) RREP_2(i_, n) #define RREP_2(i, n) RREP_3(i, 0, n) #define RREP_3(i, a, b) RREP_4(i, a, b, 1) #define RREP_4(i, a, b, s) for (LL i = (LL)(b) - 1; i >= (LL)(a); i -= (LL)(s)) #define ALL(c) std::begin(c), std::end(c) #define RALL(c) (c).rbegin(), (c).rend() #define EB emplace_back #define PB push_back #define EF emplace_front #define PF pop_front #define MP std::make_pair #define MT std::make_tuple #define FS first #define SC second using LL = long long; using UI = unsigned int; using UL = unsigned long long; using LD = long double; template using MinPQ = std::priority_queue, std::greater>; template using MaxPQ = std::priority_queue, std::less>; template void chmin(T &x, U y){ x = min(x, y); } template void chmax(T &x, U y){ x = max(x, y); } int main(){ int a, b, c; cin >> a >> b >> c; if (a != b && b != c && c != a && (b < min(a, c) || b > max(a, c))){ cout << "INF\n"; } else { int r = 0; REP(i, 1, 1010){ int x = a % i, y = b % i, z = c % i; if (x != y && y != z && z != x && (y < min(x, z) || y > max(x, z))){ r++; } } cout << r << endl; } }