#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e6;
const long long INF = 1e6;
long long po(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = (ans * x);
    y /= 2;
    x = (x * x);
  }
  return ans;
}
long long n;
long long a[N];
long long bs(long long x, long long l) {
  long long r = n;
  long long mid;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (a[mid] <= x)
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = abs(a[i]);
  }
  sort(a + 1, a + n + 1);
  long long ans = 0;
  for (long long i = 1; i < n; i++) {
    ans += (bs(a[i] * 2, i) - i);
  }
  cout << ans << '\n';
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
