#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = abs(a[i]);
  }
  sort(a + 1, a + n + 1);
  long long ans = 0;
  a[n + 1] = 1e14;
  for (int i = 1; i <= n; i++) {
    int st = 1;
    int en = n;
    long long x = a[i] * 2;
    while (st < en) {
      int mid = (st + en) / 2;
      if (x < a[mid]) {
        en = mid - 1;
      } else {
        st = mid + 1;
      }
    }
    while (a[st] > x) st--;
    while (a[st] <= x) st++;
    st--;
    if (st <= n and st > i) ans += (long long)(st - i);
  }
  cout << ans << endl;
  return 0;
}
