#include <bits/stdc++.h>
using namespace std;
int main() {
  array<unsigned long long, 10> negatives, positives;
  negatives.fill(0);
  positives.fill(0);
  unsigned long long zeros = 0;
  short temp;
  unsigned n;
  cin >> n;
  for (unsigned i = 0; i < n; i++) {
    cin >> temp;
    if (temp == 0) {
      zeros++;
    } else if (temp < 0) {
      negatives[abs(temp) - 1]++;
    } else {
      positives[temp - 1]++;
    }
  }
  unsigned long long output = 0;
  for (unsigned short i = 0; i < 10; i++) {
    output += negatives[i] * positives[i];
  }
  output += zeros * (zeros - 1) / 2;
  cout << output;
  return 0;
}
