#include <bits/stdc++.h>
using namespace std;
long long int expo_fast(long long int a, long long int b) {
  a = a;
  long long int result = 1;
  while (b) {
    if (b & 1) result = (result * a);
    b >>= 1;
    a = (a * a);
  }
  return (result);
}
void take_in(vector<long long int>* arr) {
  for (int i = 0; i < arr->size(); i++) cin >> (*(arr))[i];
}
void disp_arr(vector<long long int>* arr) {
  for (int i = 0; i < arr->size(); i++) cout << (*(arr))[i] << " ";
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, unsigned long long int y,
                    long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<long long int> arr(n);
  take_in(&arr);
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] < 0) arr[i] *= -1;
  }
  sort(arr.begin(), arr.end());
  multimap<long long int, int> mmap;
  multiset<long long int> mset;
  for (int i = 0; i < n; i++) {
    mset.insert(arr[i]);
    if (mmap.find(arr[i]) == mmap.end()) mmap.insert(make_pair(arr[i], i));
  }
  for (int i = 0; i < n; i++) {
    auto it = mset.lower_bound(2 * arr[i]);
    if (it == mset.end())
      it--;
    else if (*it > 2 * arr[i])
      it--;
    int index = (*mmap.find(*it)).second;
    index += (mset.count(*it) - 1);
    ans += (index - i);
  }
  cout << ans;
}
