#include <bits/stdc++.h>
using namespace std;
map<long long, long long> m;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (m[a[i]] == 0 && a[i] > 0) v.push_back(a[i]);
    m[a[i]]++;
  }
  long long ans = 0;
  ans += (m[0] * (m[0] - 1)) / 2;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] != 0) {
      ans += m[v[i]] * m[-1 * v[i]];
    }
  }
  cout << ans;
  return 0;
}
