#include <bits/stdc++.h>
using namespace std;
const long long size = 2005;
vector<long long> vi;
map<long long, long long> M;
long long func(long long l, long long r, long long x) {
  long long p1 = upper_bound(vi.begin(), vi.end(), r) - vi.begin();
  long long p2 = lower_bound(vi.begin(), vi.end(), l) - vi.begin();
  long long ans = p1 - p2;
  if (x == l or x == r) {
    if (M.find(x) != M.end()) ans--;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    vi.push_back(x);
    M[x]++;
  }
  sort(vi.begin(), vi.end());
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long x = vi[i];
    long long l1, r1, l2, r2;
    if (x < 0) {
      l1 = -x, r1 = -x * 2;
      l2 = 2 * x, r2 = x;
    } else {
      l1 = -2 * x, r1 = -x;
      l2 = x, r2 = 2 * x;
    }
    ans += func(l1, r1, x) + func(l2, r2, x);
  }
  for (auto x : M) {
    if (x.first > 0) {
      if (M.find(-x.first) != M.end()) ans--;
    }
  }
  cout << ans << endl;
}
