#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int N=101000;
int a[10];
bool st[N];
int main()
{
int n=0;
while(cin>>a[n])n++;
int t=a[n-1];
int ans=0;
for(int i=0;i<n-1;i++)
{
for(int k=1;k*a[i]<=t;k++)
{
st[k*a[i]]=true;
}
}
for(int i=1;i<=t;i++)
{
if(st[i]==true)
ans++;
}
cout<<ans;
return 0;
}
拓展:
假如a[i]很大怎么办 映射判断ture ,false