#include #include using namespace std; int main() { int N; int num[3]; int count = 0; cin >> N; cin >> num[0] >> num[1] >> num[2]; sort(num, num + 3); for (int i = 1; i <= N; i++) { for (int j = 0; j < 3; j++) { if (i % num[j] == 0) { count++; break; } } } cout << count << endl; return 0; }