#include <bits/stdc++.h>
using namespace std;
int n, i, ma, ans, s, v[1010];
bool ap[300010];
int main() {
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> v[i];
    ap[v[i]] = true;
  }
  for (s = 2; s <= 200010; ++s) {
    ans = 0;
    for (i = 1; i <= n; ++i) {
      if (s < v[i]) continue;
      if (ap[s - v[i]] && s - v[i] != v[i]) ++ans;
    }
    ma = max(ma, ans / 2);
  }
  cout << ma;
  return 0;
}
