#include <bits/stdc++.h>
using namespace std;
const int MXN = (int)3e5 + 10;
const int INF = (int)1e9 + 7;
const double EPS = 1e-9;
long long ans;
int n;
map<int, int> a;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  for (map<int, int>::iterator it = a.begin(); it != a.end(); ++it) {
    int k = it->first, kk = it->second;
    if (k >= 0) {
      if (!k)
        ans += kk * 1LL * (kk - 1) / 2;
      else
        ans += kk * 1LL * a[-k];
    }
  }
  printf("%I64d", ans);
  return 0;
}
