/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
	static int find(int b[], int k )
	{
		int n=b.length;
		Map<Integer,Integer> m=new HashMap<>();
		Map<Integer,Integer> used=new HashMap<>();
		
		for(int ele:b)
		m.put(ele,m.getOrDefault(ele,0)+1);
		
		int ans=0;
		for(int ele:b)
		{
			int cpl=k-ele;
			if(m.containsKey(cpl))
			{
				if(!used.containsKey(ele) && !used.containsKey(cpl))
				{
					if(cpl==ele)
					ans+=m.get(cpl)/2;
					else
					ans+=Math.min(m.get(ele), m.get(cpl));
					
					used.put(ele,1);
					used.put(cpl,1);
				}
			}
		}
		return ans;
	}
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b[]=new int[n];
		for(int i=0;i<n;i++)
		b[i]=sc.nextInt();
		
		int temp=0;
		for(int i=0;i<n;i++)
		{
			for(int j=i+1;j<n;j++)
			{
				int k=b[i]+b[j];
				temp=Math.max(temp,find(b,k));
			}
		}
		System.out.println(temp);
	}
}