#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long b;
    cin >> b;
    if (b < 0) b *= -1;
    a.push_back(b);
  }
  sort(a.begin(), a.end());
  long long sol = 0;
  for (int i = 0; i < n; i++) {
    long long t = a[i] * 2;
    long long dis = distance(a.begin(), upper_bound(a.begin(), a.end(), t));
    dis -= (i + 1);
    sol += dis;
  }
  cout << sol << endl;
  return 0;
}
