#include <bits/stdc++.h>
using namespace std;
bool compare(const long long &a, const long long &b) { return abs(a) < abs(b); }
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n, compare);
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    long long l = i + 1, r = n - 1, m, z = 0;
    while (l <= r) {
      m = (l + r) >> 1;
      long long y = abs(a[m]);
      long long x = abs(a[i]);
      if (x > y) swap(x, y);
      long long x1 = abs(a[i] - a[m]);
      long long y1 = abs(a[i] + a[m]);
      if (x1 > y1) swap(x1, y1);
      if (x1 <= x && y1 >= y) {
        z = m - i;
        l = m + 1;
      } else
        r = m - 1;
    }
    ans += z;
  }
  cout << ans;
  return 0;
}
