#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long, long long> nums;
  vector<long long> numbers;
  int n;
  cin >> n;
  long long number;
  while (cin >> number) {
    numbers.push_back(number);
  }
  long long count = 0;
  for (int i = 0; i < numbers.size(); i++) {
    if (nums.find(numbers[i]) == nums.end()) {
      nums.insert(pair<long long, long long>(numbers[i], 1));
    } else if (nums.find(numbers[i]) != nums.end()) {
      nums[numbers[i]]++;
    }
  }
  for (const auto &myPair : nums) {
    if (myPair.first == 0) {
      long long product = (nums[0] * (nums[0] - 1)) / 2;
      count += product;
      continue;
    }
    if (myPair.first < 0) {
      continue;
    } else {
      long long product = nums[myPair.first] * nums[-myPair.first];
      count += product;
    }
  }
  cout << count << endl;
}
