#include #define REP(i,s,n) for(int i=s;i> N >> a >> b >> c; ll v1 = N / a; ll v2 = N / b; ll v3 = N / c; ll ab = a / __gcd(a,b) * b; ll ac = a / __gcd(a,c) * c; ll bc = b / __gcd(b,c) * c; ll v4 = N / ab; ll v5 = N / ac; ll v6 = N / bc; ll tmp = a / __gcd(a,b) * b; ll abc = tmp / __gcd(tmp,c) * c; ll v7 = N / abc; cout << v1 + v2 + v3 - v4 - v5 - v6 + v7 << endl; return 0; }