#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  long long sum = 0;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> x;
    sum += mp[-x];
    mp[x]++;
  }
  cout << sum;
}
