#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char ch = getchar();
  long long s = 0, w = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
long long a[1000010], b[1000010], tot;
long long ans, c[1000010];
int n;
inline long long lowbit(long long x) { return x & (-x); }
inline void add(long long x) {
  for (; x <= tot; x += lowbit(x)) c[x]++;
}
inline long long query(long long x) {
  long long sum = 0;
  for (; x; x -= lowbit(x)) sum += c[x];
  return sum;
}
inline long long Z(long long x) {
  return lower_bound(b + 1, b + tot + 1, x) - b;
}
inline long long cmp(long long x, long long y) { return x > y; }
int main() {
  n = read();
  for (register int i = 1; i <= n; i++) a[i] = read(), a[i] = abs(a[i]);
  sort(a + 1, a + n + 1, cmp);
  for (register int i = 1; i <= n; i++) b[++tot] = a[i];
  for (register int i = 1; i <= n; i++)
    if (a[i] & 1)
      b[++tot] = a[i] / 2 + 1;
    else
      b[++tot] = a[i] / 2;
  sort(b + 1, b + tot + 1);
  tot = unique(b + 1, b + tot + 1) - b - 1;
  for (register int i = 1; i <= n; i++) {
    ans += query(Z(a[i]));
    if (!(a[i] & 1))
      add(Z(a[i] / 2));
    else
      add(Z(a[i] / 2 + 1));
  }
  printf("%I64d\n", ans);
  return 0;
}
