#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n + 1];
  map<long long, long long> mymap;
  long long neg = 0, pos = 0, zeroes = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (mymap.count(a[i]) > 0)
      mymap[a[i]]++;
    else
      mymap[a[i]] = 1;
  }
  unsigned long long ans = 0;
  for (int i = -10; i != 0; i++) {
    if (mymap.count(i) > 0) ans += mymap[i] * mymap[-1 * i];
  }
  if (mymap.count(0) > 0) ans += mymap[0] * (mymap[0] - 1) / 2;
  cout << ans;
  return 0;
}
