#include <bits/stdc++.h>
using namespace std;
const double pi = 2.0 * acos(0.0);
const double eps = 1.0e-9;
const int dr[] = {-1, 0, 1, 0}, dc[] = {0, 1, 0, -1};
const int dr6[] = {1, 1, 0, -1, -1, 0}, dc6[] = {0, 1, 1, 0, -1, -1};
const int dr8[] = {-1, -1, 0, 1, 1, 1, 0, -1},
          dc8[] = {0, 1, 1, 1, 0, -1, -1, -1};
int main(void) {
  int kase = 1000000000;
  for (int ks = 1, n; ks <= kase && cin >> n; ++ks) {
    int c[32] = {0};
    for (int i = 0, x; i < n && cin >> x; ++i) ++c[x + 16];
    long long s = (long long)c[16] * (c[16] - 1) / 2;
    for (int i = 1; i <= 10; ++i) s += (long long)c[16 - i] * c[16 + i];
    cout << s << endl;
  }
  return 0;
}
