#include <bits/stdc++.h>
using namespace std;
long long r;
vector<long long> v;
long long check(long long mi) {
  if (v[mi] <= 2 * v[r])
    return 1;
  else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  long long x;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    long long y = abs(x);
    v.push_back(y);
  }
  long long ans = 0;
  long long res = 0;
  long long mid;
  sort(v.begin(), v.end());
  for (long long i = 0; i < n - 1; i++) {
    long long ans = i;
    r = i;
    long long l = i;
    long long h = n - 1;
    while (l <= h) {
      mid = l + (h - l) / 2;
      if (check(mid)) {
        l = mid + 1;
        ans = max(mid, ans);
      } else
        h = mid - 1;
    }
    res += ans - i;
  }
  cout << res;
  return 0;
}
