#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0, n, temp;
  vector<int> a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  sort(a.begin(), a.end());
  for (vector<int>::iterator it1beg = a.begin(); it1beg != a.end(); it1beg++) {
    for (vector<int>::reverse_iterator it1end = a.rbegin(); *it1beg < *it1end;
         it1end++) {
      vector<int>::iterator it2beg = it1beg;
      vector<int>::reverse_iterator it2end = it1end;
      int val = *it1beg + *it1end;
      temp = 0;
      while (*it2beg < *it2end) {
        if (*it2beg + *it2end < val)
          it2beg++;
        else if (*it2beg + *it2end > val)
          it2end++;
        else {
          temp++;
          it2beg++;
          it2end++;
        }
      }
      if (ans < temp) ans = temp;
    }
  }
  cout << ans;
  return 0;
}
