#include <bits/stdc++.h>
using namespace std;
vector<int> pos, neg;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] >= 0)
      pos.push_back(a[i]);
    else
      neg.push_back(-a[i]);
  }
  sort(pos.begin(), pos.end());
  sort(neg.begin(), neg.end());
  long long int ans = 0;
  for (int i = 0; i < pos.size(); i++) {
    int beg = upper_bound(pos.begin(), pos.end(), pos[i]) - pos.begin();
    int ed = upper_bound(pos.begin(), pos.end(), pos[i] * 2) - pos.begin();
    ans += (ed - beg);
  }
  for (int i = 0; i < neg.size(); i++) {
    int beg = upper_bound(neg.begin(), neg.end(), neg[i]) - neg.begin();
    int ed = upper_bound(neg.begin(), neg.end(), neg[i] * 2) - neg.begin();
    ans += (ed - beg);
    int beg2 =
        lower_bound(pos.begin(), pos.end(), (neg[i] + 1) / 2) - pos.begin();
    int ed2 = upper_bound(pos.begin(), pos.end(), neg[i] * 2) - pos.begin();
    ans += (ed2 - beg2);
  }
  cout << ans << endl;
}
