#include <bits/stdc++.h>
const int MX = 5e5 + 69;
using namespace std;
const long long mod = 998244353;
const long long mod2 = 1e9 + 9;
const double eps = 1e-9;
vector<int> v;
vector<int>::iterator it, tt;
int p = 1;
int a[MX];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    v.push_back(abs(a[i]));
  }
  sort(v.begin(), v.end());
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int x = (abs(v[i]) + 1) / 2;
    int y = 2 * abs(v[i]);
    it = lower_bound(v.begin(), v.end(), x);
    tt = upper_bound(v.begin(), v.end(), y);
    tt--;
    int res = (tt - it);
    ans += res;
  }
  cout << ans / 2 << endl;
  return 0;
}
