#include <bits/stdc++.h>
using namespace std;
int mov[4][2] = {
    -1, 0, 0, 1, 1, 0, 0, -1,
};
template <typename T>
struct number_iterator : std::iterator<random_access_iterator_tag, T> {
  T v;
  number_iterator(T _v) : v(_v) {}
  operator T&() { return v; }
  T operator*() const { return v; }
};
template <typename T>
struct number_range {
  T b, e;
  number_range(T b, T e) : b(b), e(e) {}
  number_iterator<T> begin() { return b; }
  number_iterator<T> end() { return e; }
};
template <typename T>
number_range<T> range(T e) {
  return number_range<T>(0, e);
}
template <typename T>
number_range<T> range(T b, T e) {
  return number_range<T>(b, e);
}
struct mycomp {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    if (a.first > b.first) return true;
    if (a.first == b.first && a.second < b.second) return true;
    return false;
  }
};
bool my_pair_comp(pair<int, int> a, pair<int, int> b) {
  if (a.first > b.first) return true;
  if (a.first == b.first) return a.second < b.second;
  return false;
}
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  while (n--) {
    int a;
    cin >> a;
    m[a]++;
  }
  long long total = 0;
  for (auto a : m) {
    if (a.first == 0) {
      long long d = m[a.first];
      total += d * (d - 1) / 2;
      break;
    } else if (a.first < 0) {
      long long d1 = m[a.first];
      long long d2 = m[-a.first];
      total += d1 * d2;
    }
  }
  cout << total << endl;
  return 0;
}
