#include using namespace std; int main(){ int n,a,b,c; cin >> n >> a >> b >> c; cout << n/a+n/b+n/c-n/(a+b)-n/(a+c)-n/(b+c)+n/(a+b+c) << endl; return 0; }