#include <bits/stdc++.h>
using namespace std;
double PI = 3.141592653589793;
const double EPS = 1e-9;
const int N = 1e6 + 5;
const long long mod = 1e9 + 7;
const int oo = 1e9;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
map<int, int> freq;
int n;
int main() {
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 0; i <= n - 1; i++) {
    int a;
    scanf("%d", &a);
    freq[a]++;
    if (a == 0)
      ans += freq[a] - 1;
    else
      ans += freq[-a];
  }
  printf("%lld", ans);
}
