#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e9 + 7;
void solve() {
  long long int n, ans = 0, cur;
  cin >> n;
  map<long long int, long long int> mp;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    if (mp.find(-cur) != mp.end()) ans += mp[-cur];
    mp[cur]++;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) solve();
}
