#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i=0;i--) #define all(a) a.begin(),a.end() #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) #define SS stringstream #define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts(""); #define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");} #define bitcount(b) __builtin_popcount(b) #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) int main(){ long long N; cin >> N; long long a,b,c; cin >> a >> b >> c; cout << N/a+N/b+N/c-N/(a*b)-N/(c*b)-N/(a*c)+N/(a*b*c) << endl; }