#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, k, ans = 0;
  set<long long> co;
  multiset<long long> all;
  multiset<long long>::iterator p;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> k;
    all.insert(k);
  }
  for (p = all.begin(); p != all.end(); p++) {
    if (*p == 0 || co.count(abs(*p))) continue;
    ans += all.count(*p) * all.count(-(*p));
    co.insert(abs(*p));
  }
  k = all.count(0);
  if (k) ans += k * (k - 1) / 2;
  cout << ans << endl;
}
