#include #define p(s) cout<<(s)<>N>>a>>b>>c; ans+=N/a+N/b+N/c; ll lcm_ba=b/__gcd(a,b)*a; ll lcm_ca=c/__gcd(a,c)*a; ll lcm_cb=c/__gcd(b,c)*b; ll lcm_abc=a/__gcd(lcm_cb,a)*lcm_cb; ans-=N/lcm_ba+N/lcm_ca+N/lcm_cb; ans += N/lcm_abc; p(ans); return 0; }