#include <bits/stdc++.h>
const long long q = 20;
using namespace std;
long long n, ans, a[100], x;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x, a[x + q]++;
  for (int i = -10; i < 0; i++) {
    x = a[i + q] * a[i + q + 2 * abs(i)];
    ans += x;
  }
  ans += (a[q] * (a[q] - 1)) / 2;
  cout << ans;
  return 0;
}
