#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int c[200005];
int d[200006];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n + 2];
  for (int i = 0; i < n; ++i) cin >> a[i], d[a[i]]++;
  int ans = 0;
  for (int i = 2; i <= 2e5; ++i) {
    int zn = i / 2, kol = 0;
    c[zn] = i;
    for (int j = 0; j < n; ++j)
      if (c[a[j]] != i && a[j] < i) {
        c[a[j]] = i;
        c[i - a[j]] = i;
        kol += min(d[a[j]], d[i - a[j]]);
      }
    if (i % 2 == 0) kol += d[zn] / 2;
    ans = max(ans, kol);
  }
  cout << ans;
}
