#include #include #include #include using namespace std; typedef long long ll; int main() { ll N; cin>>N; ll a, b, c; cin>>a>>b>>c; ll a_v, b_v, c_v; ll ab_v, bc_v, ca_v; a_v = N/a; b_v = N/b, c_v = N/c; ab_v = N/(a*b); bc_v = N/(b*c); ca_v = N/(c*a); ll abc_v = N/(a*b*c); if(b%a==0) {b_v = 0; ab_v = 0; bc_v = 0; abc_v = 0;} if(c%a==0) {c_v = 0; ca_v = 0; bc_v = 0; abc_v = 0;} if(c%b==0) {c_v = 0; bc_v = 0; ca_v = 0; abc_v = 0;} ll ans = a_v + b_v + c_v - ab_v - bc_v - ca_v + abc_v; cout<