#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[maxn];
int main() {
  int n, m, k;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n + 1);
  int ans = 0;
  for (int sum = 2; sum <= 2e5; sum++) {
    int cnt = 0;
    int p = 1, q = n;
    while (p < q) {
      if (a[p] + a[q] == sum) {
        cnt++;
        p++;
        q--;
      } else if (a[p] + a[q] > sum) {
        q--;
      } else {
        p++;
      }
    }
    ans = max(ans, cnt);
  }
  printf("%d\n", ans);
}
