#include <bits/stdc++.h>
using namespace std;
long long int n, m, ar[1000005], sum;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ar[i];
  for (int i = 1; i <= n; i++) ar[i] = fabs(ar[i]);
  sort(ar + 1, ar + n + 1);
  ar[n + 1] = 100000000000000009;
  int l = 1;
  int r = 2;
  while (r <= n + 1) {
    if (ar[r] - ar[l] > ar[l])
      l++;
    else {
      r++;
      sum += max(r - l - 1, 0);
    }
    if (l == r) r++;
  }
  cout << sum;
}
