#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 2;
int a[maxn], b[maxn * maxn], c[maxn * maxn], dem = 0, ans = 0;
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  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++) {
      b[dem] = a[i] + a[j];
      c[b[dem]]++;
      ans = max(ans, c[b[dem]]);
      dem++;
    }
  }
  cout << ans;
}
