#include <bits/stdc++.h>
using namespace std;
int binarySearch(long long A[], int start, int end, long long val) {
  if (start > end) {
    return end;
  }
  int mid = (start + end) / 2;
  int x = abs(A[mid] - val);
  int y = abs(A[mid + 1] - val);
  if (x <= val && y > val) {
    return mid;
  }
  if (x > val) {
    return binarySearch(A, start, mid - 1, val);
  } else {
    return binarySearch(A, mid + 1, end, val);
  }
}
int main() {
  int n;
  cin >> n;
  long long A[n], a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    A[i] = abs(a);
  }
  sort(A, A + n);
  long long count = 0;
  for (int i = 0; i < n; i++) {
    int x = abs(A[n - 1] - A[i]);
    if (i + 1 < n) {
      int y = abs(A[i + 1] - A[i]);
      if (y > A[i]) continue;
    }
    if (x <= A[i]) {
      count += (n - i - 1);
    } else {
      int idx = binarySearch(A, i + 1, n - 1, A[i]);
      count += (idx - i);
    }
  }
  cout << count;
  return 0;
}
