//#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl") #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; #define LL long long #define DB double #define LD long double #define ST string #define BS bitset #define PA pair #define VE vector #define VL VE #define VP VE #define VVL VE #define VVVL VE #define PQ priority_queue #define PQS priority_queue,greater> #define FI first #define SE second #define PB push_back #define POB pop_back #define PF push_front #define POF pop_front #define MP make_pair #define TS to_string #define TU to_ullong #define BPL __builtin_popcountll #define FOR(i,a,n) for(i=a;i=a;--i) #define rep(i,n) FOR(i,0,n) #define repr(i,n) FORR(i,0,n) #define ALL(a) a.begin(),a.end() #define RALL(a) a.rbegin(),a.rend() #define SORT(a) sort(ALL(a)) #define REV(a) reverse(ALL(a)) #define UB(a,n) *upper_bound(ALL(a),n) #define UBn(a,n) upper_bound(ALL(a),n)-a.begin() #define LB(a,n) *lower_bound(ALL(a),n) #define LBn(a,n) lower_bound(ALL(a),n)-a.begin() #define INF 1000000000000000003 #define PI 3.14159265358979323846264338327950288 //#define MOD 1000000007 #define MOD 998244353 #define ERR 1e-10 #define coutl cout<0){if(n&1)ans=ans*a%m;a=a*a%m;n>>=1;}return ans;} VL fact,finv,inv; void comi(LL n){LL i;fact.resize(max(2LL,n+1));finv.resize(max(2LL,n+1));inv.resize(max(2LL,n+1));fact[0]=fact[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,n+1){fact[i]=fact[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}} LL com(LL n,LL k){if(nbool chmax(T &a,T b){if(abool chmin(T &a,T b){if(a>b){a=b;return true;}return false;} int main(){ FAST; LL i,j,ans=0,A,B,C,n; cin>>A>>B>>C; if(GCD(GCD(A,B),C)>1){ cout<<"INF"<=n)break; v[A*i+B*j-1]=1; } } rep(i,n)if(!v[i]){ if((i+1)%C==0)v[i]=1; else if(i-C<0)++ans; else if(v[i-C])v[i]=1; else ++ans; } //vout(v); cout<A*B)break; v[A*i+B*j-1]=1; } } rep(i,A*B)if(!v[i]){ if((i+1)%C==0)v[i]=1; else if(i-C<0)++ans; else if(v[i-C])v[i]=1; else ++ans; } //vout(v); cout<A*B)break; v[A*i+B*j-1]=1; } } rep(i,A*B)if(!v[i]){ if((i+1)%C==0)v[i]=1; else if(i-C<0)++ans; else if(v[i-C])v[i]=1; else ++ans; } //vout(v); cout<