#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, times = 0, sweets[1003] = {0};
  map<int, int> stat;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> sweets[i];
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      stat[sweets[i] + sweets[j]]++;
      if (times < stat[sweets[i] + sweets[j]])
        times = stat[sweets[i] + sweets[j]];
    }
  }
  cout << times << endl;
  return 0;
}
