#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
inline long long int in() {
  long long int p = 0;
  register char ch = 0;
  while (ch < '0' or ch > '9') {
    ch = getchar();
  }
  while (ch >= '0' and ch <= '9') {
    p = (p << 1) + (p << 3) + ch - '0';
    ch = getchar();
  }
  return p;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int ar[n], co = 0;
  ;
  map<long long int, long long int> mp1, mp2;
  set<long long int> v;
  for (long long int i = 0; i < n; i++) {
    cin >> ar[i];
    if (ar[i] == 0)
      co++;
    else {
      if (ar[i] > 0) {
        mp1[ar[i]]++;
        v.insert(ar[i]);
      } else
        mp2[abs(ar[i])]++;
    }
  }
  long long int ans = 0;
  for (auto itr = v.begin(); itr != v.end(); ++itr) {
    long long int f1 = mp1[*itr];
    long long int f2 = mp2[*itr];
    ans += f1 * f2;
  }
  cout << ans + ((co * (co - 1)) / 2) << endl;
  return 0;
}
