#include <bits/stdc++.h>
using namespace std;
inline int Int(string S) {
  int Number;
  istringstream Str(S);
  Str >> Number;
  return Number;
}
template <class T>
inline string String(T Number) {
  ostringstream Str;
  Str << Number;
  return Str.str();
}
template <class T>
inline T Sqr(T Number) {
  return Number * Number;
}
int N;
long long int Cnt[25];
int main(void) {
  cin >> N;
  for (int i = 0; i < 25; i++) Cnt[i] = 0LL;
  long long int Sol = 0LL;
  for (int i = 0; i < N; i++) {
    int Number;
    cin >> Number;
    Number += 10;
    Cnt[Number] += 1LL;
    Number -= 10;
    Number *= -1;
    Number += 10;
    Sol += Cnt[Number];
    if (Number == 10) Sol--;
  }
  cout << Sol << endl;
  return 0;
}
