#include <bits/stdc++.h>
using namespace std;
map<long long, long long> M;
int main() {
  long long i, j, n, s = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> j;
    M[j]++;
  }
  map<long long, long long>::iterator it;
  for (it = M.begin(); it != M.end(); it++) {
    if (it->first < 0) continue;
    if (it->first == 0) {
      s += ((it->second) * (it->second - 1)) / 2;
      continue;
    }
    s += it->second * M[it->first * -1];
  }
  cout << s << endl;
  return 0;
}
