#include <bits/stdc++.h>
using namespace std;
void pv(vector<long long int> arr, long long int size) {
  for (long long int i = 0; i < size; i++) {
    cout << arr[i] << ' ';
  }
}
void gv(vector<long long int> &arr) {
  long long int size = arr.size();
  for (long long int i = 0; i < size; i++) {
    cin >> arr[i];
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  gv(arr);
  long long int low = 0, high = arr[n - 1] + arr[n - 2], mid;
  mid = high - (high - low) / 2;
  long long int hash[500000] = {0}, c = 0, mm = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      hash[arr[i] + arr[j]]++;
      mm = max(mm, hash[arr[i] + arr[j]]);
    }
  }
  cout << mm;
  return 0;
}
