#include <bits/stdc++.h>
using namespace std;
const int sizes = 200001;
int main() {
  long long int i, j, k, l, m, n, o, p, q, r, s, t, a[sizes], b[sizes],
      booked[1001];
  cin >> n;
  o = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    o = max(o, a[i]);
  }
  sort(a, a + n);
  memset(b, -1, sizeof(b));
  for (i = 0; i < n; i++) {
    b[a[i]] = i;
  }
  long long int ans = 1;
  for (i = 2 * 1; i <= 2 * o; i++) {
    memset(booked, 0, sizeof(booked));
    p = 0;
    for (j = 0; j < n; j++) {
      if (booked[j] == 0) {
        if ((i - a[j] > 0) && b[i - a[j]] != -1) {
          if (booked[b[i - a[j]]] == 0 && j != b[i - a[j]]) {
            booked[j] = 1;
            booked[b[i - a[j]]] = 1;
            p++;
          }
        }
      }
    }
    ans = max(ans, p);
  }
  cout << ans << endl;
  return 0;
}
