#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, mas[1001] = {0};
  int a;
  long long result = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    result += mas[(-a) + 100];
    mas[(a) + 100]++;
  }
  cout << result;
}
