#include<cstdio>
#include<cctype>
#include<queue>
#include<cmath>
#include<cstring>
#include<algorithm>
#define rep(i,s,t) for(int i=s;i<=t;i++)
#define dwn(i,s,t) for(int i=s;i>=t;i--)
#define ren for(int i=first[x];i!=-1;i=next[i])
using namespace std;
inline int read() {
int x=0,f=1;char c=getchar();
for(;!isdigit(c);c=getchar()) if(c==‘-‘) f=-1;
for(;isdigit(c);c=getchar()) x=x*10+c-‘0‘;
return x*f;
}
typedef long long ll;
const int maxn=100010;
ll cal(ll a) {
ll res=1;
for(ll i=2;i*i<=a;i++) if(a%i==0) {
int cnt=1;
while(a%i==0) a/=i,cnt++;
res*=cnt;
}
if(a>1) res<<=1;
return res;
}
ll A[maxn],B[maxn],ans;
int od[maxn];
int cmp(int x,int y) {return B[x]>B[y];}
int main() {
int n=read();
rep(i,1,n) A[i]=read(),B[i]=cal(A[i]),od[i]=i;
sort(od+1,od+n+1,cmp);
n=min(n,1000);
rep(i,1,n) rep(j,i,n) if((ll)B[od[i]]*B[od[j]]>=ans) ans=max(ans,cal(A[od[i]]*A[od[j]]));
printf("%lld\n",ans);
return 0;
}