#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> interests;
  map<int, int>::iterator it;
  int n, t;
  long long s1 = 0, s2 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    interests[t]++;
  }
  for (auto couple : interests) {
    if (interests.find(couple.first * -1) != interests.end() &&
        couple.first != 0) {
      it = interests.find(couple.first * -1);
      s1 += (long long)couple.second * it->second;
    }
    if (couple.first == 0) {
      s2 += ((long long)couple.second * (couple.second - 1)) / 2;
    }
  }
  cout << (s1 / 2) + s2 << endl;
  return 0;
}
