#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000 * 1000;
int main() {
  map<int, long long> m;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    m[x]++;
  }
  long long res = m[0] * (m[0] - 1) / 2;
  for (map<int, long long>::iterator it = m.begin(); it != m.end(); it++)
    if (it->first < 0) res += m[it->first] * m[-(it->first)];
  cout << res << endl;
  return 0;
}
