#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000000;
template <class T>
T read(T& x) {
  char c;
  int flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag *= -1;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= flag;
  return x;
}
template <class T>
T pw(T a, T b) {
  T res = 1;
  while (b) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return res;
}
template <class T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <class T>
T exgcd(T a, T b, T& x, T& y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  T d = exgcd(b, a % b, x, y);
  T t = x;
  x = y;
  y = t - (a / b) * y;
  return d;
}
long long a[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    a[i] = abs(a[i]);
  }
  sort(a + 1, a + 1 + n);
  int l = 1, r = 0;
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    while (!(a[l] <= 2 * a[i] && a[l] >= a[i])) l++;
    while (a[r + 1] <= 2 * a[i] && a[r + 1] >= a[i]) r++;
    l = max(l, i + 1);
    if (r >= l) ans += (r - l + 1);
  }
  cout << ans << '\n';
}
