#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  int x;
  vector<long long> a;
  set<long long> b;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
    b.insert(x);
  }
  set<long long>::iterator it;
  long long k = 0;
  for (it = b.begin(); it != b.end(); ++it) {
    if (*it > 0) {
      break;
    } else {
      if (*it != 0) {
        long long d = count(a.begin(), a.end(), *it);
        long long l = count(a.begin(), a.end(), -(*it));
        k = k + d * l;
      } else {
        long long t = count(a.begin(), a.end(), 0) - 1;
        k = k + ((t * (t + 1)) / 2);
      }
    }
  }
  cout << k << endl;
  return (0);
}
