#include int main() { long N; int a,b,c; int num = 0; std::cin >> N; std::cin >> a >> b >> c; num=(N / a) + ((N / b) - (N / b / a)) + ((N / c) - (N / a / c) - (N / b / c)); std::cout << num << std::endl; return 0; }