#include <bits/stdc++.h>
const double PI = 3.14159265358979323846;
using namespace std;
int main() {
  std::map<int, long long> pairs;
  std::set<long long> positive;
  int n;
  std::cin >> n;
  std::vector<int> nums(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> nums[i];
    if (nums[i] > 0) {
      positive.insert(nums[i]);
    }
    pairs[nums[i]]++;
  }
  long long result = 0;
  if (pairs[0]) {
    result += pairs[0] * (pairs[0] - 1) / 2;
  }
  for (std::set<long long>::iterator itr = positive.begin();
       itr != positive.end(); ++itr) {
    result += pairs[*itr] * pairs[-(*itr)];
  }
  std::cout << result << std::endl;
  return 0;
}
