#include <bits/stdc++.h>
using namespace std;
struct HASH {
  size_t operator()(const pair<int, int>& x) const {
    return hash<long long>()(((long long)x.first) ^
                             (((long long)x.second) << 32));
  }
};
unordered_map<pair<int, int>, int, HASH> Rank;
int sum[500001 + 1];
int A[2001];
int main() {
  int t;
  t = 1;
  while (t--) {
    int N;
    cin >> N;
    for (int i = 1; i <= 500001; i++) sum[i] = 0;
    for (int i = 1; i <= N; i++) {
      cin >> A[i];
    }
    for (int i = 1; i <= N; i++)
      for (int j = i + 1; j <= N; j++) sum[A[i] + A[j]]++;
    int ans = 0;
    for (int i = 1; i < 500001; i++) ans = max(sum[i], ans);
    cout << ans << endl;
  }
}
