#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(int i=(a);i<(b);++i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define MOD 1000000007 int main(){ int n; cin>>n; int a,b,c; cin>>a>>b>>c; int ans = n/a+n/b+n/c; ans -= n/(a*b)+n/(a*c)+n/(b*c); ans += n/(a*b*c); cout << ans << endl; return 0; }