#include using namespace std; using ull = unsigned long long int; bool judge(ull, ull, ull, ull); ull sum(ull, ull, ull, ull); int main() { ull n, a, b, c; cin >> n; cin >> a >> b >> c; std::cout << sum(n, a, b, c) << std::endl; return 0; } bool judge(ull num, ull a, ull b, ull c){ return !(num%a) || !(num%b) || !(num%c); } ull sum(ull n, ull a, ull b, ull c){ ull current = 1, ans = 0; while(current <= n){ if(judge(current,a,b,c)){ ans++; } current++; } return ans; }