#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[1005];
int main() {
  long long n;
  while (cin >> n) {
    memset(a, 0, sizeof(a));
    for (int i = 0; i < n; i++) {
      cin >> b[i];
    }
    long long maxn = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        a[b[i] + b[j]]++;
        if (a[maxn] < a[b[i] + b[j]]) {
          maxn = b[i] + b[j];
        }
      }
    }
    cout << a[maxn] << endl;
  }
  return 0;
}
