#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const long double pi = acos(-1.0);
int main() {
  int n;
  cin >> n;
  vector<int> s;
  map<int, int> sp;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    s.push_back(num);
    sp[num]++;
  }
  map<int, int>::iterator it = sp.begin();
  long long res = 0;
  while (it != sp.end()) {
    if (it->first > 0) res += it->second * (long long)sp[-1 * it->first];
    it++;
  }
  res += sp[0] * (long long)(sp[0] - 1) / 2;
  cout << res << endl;
  return 0;
}
