#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n], i, z = 0, p1, p2, ans = 0, pos[n], neg[n], pos1 = 0,
                         pos2 = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0)
      pos[pos1++] = a[i];
    else if (a[i] < 0)
      neg[pos2++] = a[i];
    else
      z++;
  }
  ans = (z * (z - 1)) / 2;
  if (pos1 > 0) sort(pos, pos + pos1);
  if (pos2 > 0) sort(neg, neg + pos2);
  p1 = pos1 - 1;
  p2 = pos1 - 1;
  for (i = 0; i < pos2; i++) {
    while (p1 >= 0 && pos[p1] >= abs(floor((double)neg[i] / 2.0))) {
      p1--;
    }
    while (p2 >= 0 && pos[p2] > abs(2 * neg[i])) {
      p2--;
    }
    if (p2 > p1) ans += p2 - p1;
  }
  p1 = p2 = 0;
  for (i = 0; i < pos2; i++) {
    while (p1 < pos2 && neg[p1] < 2 * neg[i]) p1++;
    while (p2 < pos2 && neg[p2] <= floor((double)neg[i] / 2.0)) p2++;
    if (p2 > p1) ans += p2 - p1;
  }
  p1 = p2 = pos1 - 1;
  for (i = pos1 - 1; i >= 0; i--) {
    while (p1 >= 0 && pos[p1] >= ceil((double)pos[i] / 2.0)) p1--;
    while (p2 >= 0 && pos[p2] > 2 * pos[i]) p2--;
    if (p2 > p1) ans += p2 - p1;
  }
  p1 = p2 = 0;
  for (i = pos1 - 1; i >= 0; i--) {
    while (p1 < pos2 && 2 * pos[i] < abs(neg[p1])) p1++;
    while (p2 < pos2 && ceil((double)pos[i] / 2.0) <= abs(neg[p2])) p2++;
    if (p2 > p1) ans += p2 - p1;
  }
  ans -= pos1 + pos2;
  cout << ans / 2 << endl;
  return 0;
}
