#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 1;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  long long Ans = 0;
  for (int &x : a) {
    scanf("%d", &x);
    if (mp.find(-x) != mp.end()) {
      Ans += mp[-x];
    }
    mp[x]++;
  }
  cout << Ans;
}
