#include <bits/stdc++.h>
using namespace std;
long long sol[100];
unsigned long long ans;
int A[100005], N;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= N; i++) {
    ans += (sol + 15)[-A[i]];
    (sol + 15)[A[i]]++;
  }
  cout << ans;
  return 0;
}
