#include <bits/stdc++.h>
using namespace std;
int dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1};
int a[200005];
int main() {
  int n, i, j, ans, maxi = 0, p;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int sum = 1; sum <= 200000; sum++) {
    i = 1;
    j = n;
    ans = 0;
    while (i < j) {
      p = a[i] + a[j];
      if (p < sum)
        i++;
      else if (p > sum)
        j--;
      else {
        ans++;
        i++;
        j--;
      }
    }
    maxi = max(maxi, ans);
  }
  cout << maxi << endl;
}
