#include <bits/stdc++.h>
using namespace std;
long long arr[2000006], F[2000006];
signed main() {
  ios_base::sync_with_stdio(false);
  long long t, n, m, i, j, q, l, r, k, cnt = 0, c, ans = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
    F[arr[i]] = 1;
  }
  for (i = 1; i <= 200000; i++) {
    cnt = 0;
    for (j = 1; j <= n; j++) {
      if (i - arr[j] > 0 && F[i - arr[j]]) cnt++;
    }
    ans = max(ans, cnt);
  }
  cout << ans / 2;
  return 0;
}
