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