fork download
  1. #include <bits/stdc++.h>
  2. #include<vector>
  3. using namespace std;
  4. #define ll long long
  5. int main() {
  6. ll n;
  7. ll a,b,c,d;
  8. cin>>a>>b>>c>>d>>n;
  9. ll count=0;
  10. for(ll i=1;i<=n;i++)
  11. {
  12. if(i%a==0||i%b==0||i%c==0||i%d==0)
  13. {
  14. count++;
  15. }
  16. }
  17. cout<<count;
  18. return 0;
  19. }
Success #stdin #stdout 0s 4412KB
stdin
2
3
4
5
24


stdout
17