#include using namespace std; using Int = long long; //INSERT ABOVE HERE Int lcm(Int a,Int b){return a/__gcd(a,b)*b;}; signed main(){ Int n,a,b,c; cin>>n>>a>>b>>c; Int ans=0; for(Int i=0;i<2;i++){ for(Int j=0;j<2;j++){ for(Int k=0;k<2;k++){ Int x=1; if(i) x=lcm(x,a); if(j) x=lcm(x,b); if(k) x=lcm(x,c); if((i+j+k)&1) ans-=n/x; else ans+=n/x; } } } cout<