#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  vector<int> pos, neg;
  set<int> t1, t2;
  map<int, int> m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    m[x]++;
    if (x >= 0)
      t1.insert(x);
    else {
      t2.insert(x);
    }
  }
  long long ans = 0;
  for (auto it : t1) {
    pos.push_back(it);
  }
  for (auto it : t2) {
    neg.push_back(it);
  }
  for (auto it : pos) {
    auto it1 = lower_bound(pos.begin(), pos.end(), it + 1) - pos.begin();
    auto it2 = lower_bound(pos.begin(), pos.end(), it * 2 + 1) - pos.begin();
    auto it3 = lower_bound(neg.begin(), neg.end(), -it * 2) - neg.begin();
    auto it4 = lower_bound(neg.begin(), neg.end(), -it) - neg.begin();
    ans += (it2 - it1) + (it4 - it3);
  }
  for (auto it : neg) {
    auto it1 = lower_bound(neg.begin(), neg.end(), it) - neg.begin();
    auto it2 = lower_bound(neg.begin(), neg.end(), it * 2) - neg.begin();
    auto it3 = lower_bound(pos.begin(), pos.end(), (-it * 2) + 1) - pos.begin();
    auto it4 = lower_bound(pos.begin(), pos.end(), -it + 1) - pos.begin();
    ans += (it1 - it2) + (it3 - it4);
  }
  for (auto it : m) {
    if (it.first < 0) {
      if (it.second > 1) ans++;
      if (m[-it.first] > 0) ans++;
    }
    if (it.first > 0) {
      if (it.second > 1) ans++;
    } else {
      if (it.second > 1) ans++;
    }
  }
  cout << ans << "\n";
}
