#include using namespace std; int n,a,b,c; int main() { cin >> n >> a >> b >> c; int na = n / a,nb = n / b,nc = n / c; int nac = n / (a * c),nab = n / (a * b),nbc = n / (b * c); int nabc = n / (a * b * c); if(b % a == 0 && c % a == 0) cout << na; else if(b % a == 0) cout << na + nc - nac; else if(c % a == 0) cout << na + nb - nab; else cout << na + nb + nc - (nac + nab + nbc) + nabc; cout << endl; return 0; }