#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int i, temp, max=1, freq[100001]={0}, ans=1, j;
for(i=0;i<n;i++){
scanf("%d",&temp);
freq[temp]++;
if(temp>max){
max=temp;
}
}
for(i=2; i<=max; ++i){
temp=0;
for(j=i; j<=max; j+=i){
temp+=freq[j];
}
if(temp>ans) ans=temp;
}
printf("%d",ans);
return 0;
}
#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int i, temp, max=1, freq[100001]={0}, ans=1, j;
for(i=0;i<n;i++){
scanf("%d",&temp);
freq[temp]++;
if(temp>max){
max=temp;
}
}
for(i=2; i<=max; ++i){
temp=0;
for(j=i; j<=max; j+=i){
temp+=freq[j];
}
if(temp>ans) ans=temp;
}
printf("%d",ans);
return 0;
}