#include <bits/stdc++.h>
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 9;
const int MAX_N = 2;
const int oo = INT_MAX;
const long long int OO = 1e18;
const int dx[] = {1, -1, 0, 0, 0, 0};
const int dy[] = {0, 0, 1, -1, 0, 0};
const int dz[] = {0, 0, 0, 0, 1, -1};
using namespace std;
long long int GCD(long long int a, long long int b) {
  return ((!b) ? a : GCD(b, a % b));
}
long long int LCM(long long int a, long long int b) {
  return a / (GCD(a, b)) * b;
}
long long int nCr(long long int n, long long int r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return n * nCr(n - 1, r - 1) / r;
}
long long int PowMod(long long int bs, long long int ex, long long int M) {
  if (!ex) return 1;
  long long int p = PowMod((bs * bs) % M, ex >> 1, M);
  return (ex & 1) ? (p * bs) % M : p;
}
bool isPrime(long long int n) {
  if (n == 2) return 1;
  if (n < 2 || n % 2 == 0) return 0;
  for (long long int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return 0;
  return 1;
}
bool isPalindrome(string str) {
  long long int l = 0;
  long long int h = str.size() - 1;
  while (h > l) {
    if (str[l++] != str[h--]) {
      return 0;
    }
  }
  return 1;
}
long long int NoOfOdd(long long int L, long long int R) {
  long long int N = (R - L) / 2;
  if (R % 2 != 0 || L % 2 != 0) N++;
  return N;
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int ans = 0;
  map<long long int, long long int> mp;
  for (long long int i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    long long int tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  ans += mp[0] * (mp[0] - 1) / 2;
  for (auto i : mp) {
    if (i.first == 0)
      continue;
    else {
      ans += i.second * mp[-i.first];
      mp[-i.first] = 0;
    }
  }
  cout << ans << '\n';
}
