#include <bits/stdc++.h>
using namespace std;
long long n, a, b, i, x[11], y[11];
int main() {
  cin >> n;
  while (i < n) {
    cin >> a;
    if (a == 0) {
      b++;
    }
    if (a > 0) {
      x[a]++;
    }
    if (a < 0) {
      y[-a]++;
    }
    i++;
  }
  i = 1;
  a = 0;
  a += b * (b - 1) / 2;
  while (i <= 10) {
    a += x[i] * y[i];
    i++;
  }
  cout << a;
}
