#include
#include
#include
#include
using namespace std;
int main(){
int i,j,n,x[100],val,max=0,cur,l,r;
scanf("%d",&n);
for(i=0;i<=n-1;i++)
scanf("%d",x+i);
sort(&x[0],&x[n]);
set<int> s;
for(i=0;i<=n-1;i++){
for(j=i+1;j<=n-1;j++){
s.insert(x[i]+x[j]);
}
}
set<int>::iterator it;
for(it=s.begin();it!=s.end();it++){
val = *it;
l = 0;
r = n-1;
cur = 0;
while(l < r){
if (x[l]+x[r] > val)
r--;
if (x[l]+x[r] < val)
l++;
if (x[l]+x[r] == val){
cur++;
l++;
r--;
}
}
if(cur > max)
max = cur;
}
printf("%d\n", 2*max);
return 0;
}