#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[30] = {0}, y = 0, x;
  long long i = 0;
  cin >> n;
  for (int j = 0; j <= 30; j++) a[j] = 0;
  i = 0;
  while (n--) {
    cin >> x;
    i += a[10 - x];
    a[x + 10]++;
    if (n == 0) break;
  }
  cout << i;
  return 0;
}
