#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
long long power(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans = (ans * a) % mod;
    }
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
long long max(long long a, long long b) { return a > b ? a : b; }
bool r(pair<long long, long long> p1, pair<long long, long long> p2) {
  return (p2.first < p1.first);
}
long long min(long long a, long long b) { return a < b ? a : b; }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
const int N = 10000005;
int lp[N + 1];
vector<int> pr;
long long bs(long long a[], long long n, long long x, long long i) {
  long long cnt = 0;
  long long r, l, mid;
  l = 0;
  r = n;
  x = (x + 1) / 2;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (a[mid] >= x) {
      r = mid - 1;
      cnt = i - mid;
    } else {
      l = mid + 1;
    }
  }
  return cnt;
}
void solve() {
  long long n, ans = 0, g = 0;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = abs(a[i]);
  }
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    long long b = bs(a, n, a[i], i);
    ans += max(0, b);
  }
  cout << ans << '\n';
}
int main() {
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
