#include using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair pdd; const ull mod = 1e9 + 7; #define REP(i,n) for(int i=0;i<(int)n;++i) //debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; template ostream& operator << (ostream& os, const pair v){ os << "(" << v.first << ", " << v.second << ")"; return os; } template ostream& operator << (ostream& os, const vector v){ for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os; } template ostream& operator << (ostream& os, const vector> v){ for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os; } ll Euclid(ll A, ll B){ if(A> N; vector x(3, 0); REP(i, 3) cin >> x[i]; ll res = 0; REP(i, 8){ if(i==0) continue; ll tmp = 1; ll cnt = 0; REP(j, 3){ if(i>>j&1){ tmp = tmp*x[j]/Euclid(tmp, x[j]); cnt++; } } ll sign = (cnt%2==0 ? -1 : 1); res += sign * (N/tmp); } cout << res << endl; return 0; }