#include using namespace std; int main() { int n, a, b, c; cin >> n >> a >> b >> c; int sum = 0; bool f = false; for(int i = 1;i <= n;i++){ do{ if(i % a == 0) f = true; break; if(i % b == 0) f = true; break; if(i % c == 0) f = true; break; }while(0); if(f){ sum++; f = false; } } cout << sum << endl;; }