#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
    if (v[i] < 0) v[i] = -v[i];
  }
  sort(v.begin(), v.end());
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    long long k = ceil(v[i] / 2.0);
    auto index = lower_bound(v.begin(), v.end(), k) - v.begin();
    sum += abs(index - i);
  }
  cout << sum;
  return 0;
}
