#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n_Cases = 1;
  for (long long case_i = 1; case_i <= n_Cases; case_i++) {
    long long n;
    cin >> n;
    map<long long, long long> count;
    for (long long i = 0; i < n; i++) {
      long long input;
      cin >> input;
      count[input]++;
    }
    long long ans = 0;
    for (auto x : count) {
      if (x.first < 0) {
        auto other = count.find(-1 * x.first);
        ans += x.second * (other == count.end() ? 0 : other->second);
      }
    }
    long long zeroPairing = (count[0] * (count[0] - 1)) / 2;
    cout << ans + zeroPairing << "\n";
  }
  return 0;
}
