#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)pos[i]/2));
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i])
			itr--;
		if((*itr)<=2*pos[i])
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),ceil((long double)neg[i]/2));
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i])
			itr--;
		if((*itr)<=2*neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	for (int i = 0; i < neg.size(); ++i)
	{
		itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
		if (itr1==pos.end())
		{
			itr1--;
		}
		if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
		{
			itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

			if (itr!=pos.end())
			{
				if ((*itr)<neg[i])
				{
					ans+=((itr1-pos.begin())-(itr-pos.begin()));
				}
			}
			//debug(ans);
			itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
			if (itr==pos.end())
			{
				itr--;
				//cout << "here\n";
			}
			if((*itr)>2*neg[i])
				itr--;
			if((*itr)<=2*neg[i])
				ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
			//debug(ans);
		}

	}
	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i] && (*itr)>=ceil((long double)neg[i]/2))
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}

				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);

			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		long long tmp;
		tmp=pos[i]/2;
		if (pos[i]%2!=0)
			tmp++;

		itr=lower_bound(pos.begin(),pos.end(),tmp);
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)<=2*pos[i])
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		long long tmp;
		tmp=neg[i]/2;
		if (neg[i]%2!=0)
			tmp++;

		itr=lower_bound(neg.begin(),neg.end(),tmp);
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)<=2*neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			long long tmp;
			tmp=neg[i]/2;
			if (neg[i]%2!=0)
				tmp++;

			if ((*itr1)<=2*neg[i] && (*itr1)>=tmp)
			{
				itr=lower_bound(pos.begin(),pos.end(),tmp);

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)<=2*neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
		if (x>0)
		{
			arr.push_back(x);
		}
		if (x<0)
		{
			arr.push_back(x*-1);
		}
	}
	sort(arr.begin(), arr.end());

	long long ans=0;
	vector<long long>::iterator itr;
	for (int i = 0; i < arr.size(); ++i)
	{
		itr=lower_bound(arr.begin(),arr.end(),2*arr[i]);
		if (itr==arr.end())
		{
			itr--;
		}
		if((*itr)>2*arr[i] && itr!=arr.begin())
			itr--;
		if((*itr)<=2*arr[i])
			ans+=((itr-arr.begin())-i);

	}
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		long long tmp;
		tmp=pos[i]/2;
		if (pos[i]%2!=0)
			tmp++;

		itr=lower_bound(pos.begin(),pos.end(),tmp);
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i])
			itr--;
		if((*itr)<=2*pos[i])
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		long long tmp;
		tmp=neg[i]/2;
		if (neg[i]%2!=0)
			tmp++;

		itr=lower_bound(neg.begin(),neg.end(),tmp);
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i])
			itr--;
		if((*itr)<=2*neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			long long tmp;
			tmp=neg[i]/2;
			if (neg[i]%2!=0)
				tmp++;

			if ((*itr1)<=2*neg[i] && (*itr1)>=tmp)
			{
				itr=lower_bound(pos.begin(),pos.end(),tmp);

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i])
					itr--;
				if((*itr)<=2*neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)pos[i]/2));
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i])
			itr--;
		if((*itr)<=2*pos[i])
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),ceil((long double)neg[i]/2));
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i])
			itr--;
		if((*itr)<=2*neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i])
					itr--;
				if((*itr)<=2*neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				if((*itr)<=2*neg[i]  && (*itr)>=neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)pos[i]/2));
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (pos[i]%2!=0)
		{
			if(itr!=pos.end()){
				posans+=(i-(itr-pos.begin()));
			}else{
				//cout << "her\n";
			}
		}else{
			if (itr!=pos.end())
			{
				posans+=(i-(itr-pos.begin()));
			}
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i])
			itr--;
		posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);
	for (int i = 0; i < neg.size(); ++i)
	{
		neg[i]=neg[i]*-1;
	}
	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),ceil((long double)neg[i]/2));
		if (neg[i]%2!=0)
		{
			if(itr!=neg.end()){
				negans+=(i-(itr-neg.begin()));
			}
		}else{
			if (itr!=neg.end())
			{
				negans+=(i-(itr-neg.begin()));
			}
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i])
			itr--;
		negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	for (int i = 0; i < neg.size(); ++i)
	{
		itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));
		if (pos[i]%2!=0)
		{
			if(itr!=pos.end()){
				if ((*itr)==pos[i]/2)
					itr++;
				ans+=((itr1-pos.begin())-(itr-pos.begin()));
				if ((*itr1)!=neg[i])
				{
					ans++;
				}
			}
		}else{
			if (itr!=pos.end())
			{
				ans+=((itr1-pos.begin())-(itr-pos.begin()));
				if ((*itr1)!=neg[i])
				{
					ans++;
				}
			}
		}
		itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i])
			itr--;
		ans+=((itr-pos.begin())-(itr1-pos.begin()));
		if ((*itr1)!=neg[i])
			ans++;

	}
	//cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)pos[i]/2));
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i])
			itr--;
		if((*itr)<=2*pos[i])
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),ceil((long double)neg[i]/2));
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i])
			itr--;
		if((*itr)<=2*neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i])
					itr--;
				if((*itr)<=2*neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)pos[i]/2));
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),ceil((long double)neg[i]/2));
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				if((*itr)<=2*neg[i]  && (*itr)>=neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);

			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	long long n,x;
	cin >> n;
	vector<long long>arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		arr.push_back(abs(x));
	}
	sort(arr.begin(), arr.end());

	long long ans=0;
	vector<long long>::iterator itr;
	for (int i = 0; i < arr.size(); ++i)
	{
		itr=upper_bound(arr.begin(),arr.end(),2*arr[i]);
		if (itr==arr.end())
		{
			itr--;
		}
		if((*itr)>2*arr[i] && itr!=arr.begin())
			itr--;
		if((*itr)<=2*arr[i])
			ans+=((itr-arr.begin())-i);

	}
	cout << ans << "\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<ll> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1);
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		vector<int>::iterator it = upper_bound(pos.begin(),pos.end(),2*neg[i]);
		if(it==pos.end())
			lb=pos.size();
		else
			lb=it-pos.begin()
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<ll> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1);
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll res;
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		vector<ll>::iterator it = upper_bound(pos.begin(),pos.end(),2*neg[i]);
		if(neg[i]%2==0)
			res=neg[i]/2;
		else
			res=neg[i]/2+1;
		vector<ll>::iterator it2 = lower_bound(pos.begin(),pos.end(),res);
		lb = it-it2;
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<int> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1)+neg.size()*pos.size();
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	//cout<<pos.size();
	for(i=0;i<pos.size();i++)
	{
		int lb;
		vector<int>::iterator it= upper_bound(pos.begin(),pos.end(),2*pos[i]);
		if(it==pos.end())
			lb=pos.size()-1-i;
		else
			lb=it-(pos.begin()+i+1);
		//cout<<pos[i]<<lb<<endl;
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		int lb;
		vector<int>::iterator it= upper_bound(neg.begin(),neg.end(),2*neg[i]);
		if(it==neg.end())
			lb=neg.size()-1-i;
		else
			lb=it-(neg.begin()+i+1);
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<ll> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1);
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll res;
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		vector<ll>::iterator it = upper_bound(pos.begin(),pos.end(),2*neg[i]);
		lb = it-pos.begin();
		if(neg[i]%2==0)
			res=neg[i]/2;
		else
			res=neg[i]/2+1;
		vector<ll>::iterator it2 = lower_bound(pos.begin(),pos.end(),res);
		ll pb = it2-pos.begin();
		ans+=lb-pb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<int> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1);
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		vector<int>::iterator it = upper_bound(pos.begin(),pos.end(),2*neg[i]);
		if(it==pos.end())
			lb=pos.size();
		else
			lb=it-pos.begin();
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<int> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1)+neg.size()*pos.size();
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<int> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1);
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		lb = upper_bound(pos.begin(),pos.end(),2*neg[i])-pos.begin();
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<int> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1)+neg.size()*pos.size();
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	//cout<<pos.size();
	for(i=0;i<pos.size();i++)
	{
		int lb;
		vector<int>::iterator it= lower_bound(pos.begin(),pos.end(),2*pos[i]);
		if(it==pos.end())
			lb=pos.size()-1-i;
		else
			lb=it-(pos.begin()+i);
		//cout<<pos[i]<<lb<<endl;
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		int lb;
		vector<int>::iterator it= lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if(it==neg.end())
			lb=neg.size()-1-i;
		else
			lb=it-(neg.begin()+i);
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<ll> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	ans+=czero*(n-1);
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		vector<ll>::iterator it = upper_bound(pos.begin(),pos.end(),2*neg[i]);
		if(it==pos.end())
			lb=pos.size();
		else
			lb=it-pos.begin();
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const ll mod = 1e9+7;

void boost()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int main()
{
	ll t,n,k,i,czero=0;
	boost();
	cin>>n;
	ll arr[n+1];
	vector<ll> pos,neg;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>0)
			pos.push_back(arr[i]);
		else
		if(arr[i]<0)
			neg.push_back(-arr[i]);
		if(arr[i]==0)
			czero++;
	}
	ll ans=0;
	sort(pos.begin(),pos.end());
	sort(neg.begin(),neg.end());
	for(i=0;i<pos.size();i++)
	{
		ll lb = upper_bound(pos.begin(),pos.end(),2*pos[i])-(pos.begin()+i+1);
		ans+=lb;
	}
	for(i=0;i<neg.size();i++)
	{
		ll res;
		ll lb = upper_bound(neg.begin(),neg.end(),2*neg[i])-(neg.begin()+i+1);
		ans+=lb;
		vector<ll>::iterator it = upper_bound(pos.begin(),pos.end(),2*neg[i]);
		if(neg[i]%2==0)
			res=neg[i]/2;
		else
			res=neg[i]/2+1;
		vector<ll>::iterator it2 = lower_bound(pos.begin(),pos.end(),res);
		lb = it-it2;
		ans+=lb;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	int count=0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j<n ; ++j)
		{
			ll z=abs(a[i]);
			ll h=abs(a[j]);
			ll x,y;
			if(z>h)
			{
				x=h;
				y=z;
			}
			else
			{
				x=z;
				y=h;
			}
			if(y-x>x)
			{
				break;
			}
			ll x1=abs(x-y);
			ll y1=abs(x+y);
			if(x>=x1 && y<=y1)
			{
				count++;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	int count=0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j<n ; ++j)
		{
			ll z=abs(a[i]);
			ll h=abs(a[j]);
			ll x,y;
			if(z>h)
			{
				x=h;
				y=z;
			}
			else
			{
				x=z;
				y=h;
			}
			ll x1=abs(x-y);
			ll y1=abs(x+y);
			if(x>=x1 && y<=y1)
			{
				count++;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	int count=0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j<n ; ++j)
		{
			ll z=abs(a[i]);
			ll h=abs(a[j]);
			ll x,y;
			if(z>h)
			{
				x=h;
				y=z;
			}
			else
			{
				x=z;
				y=h;
			}
			if(y-x > x && a[i]*a[j]>0)
			{
				break;
			}
			ll x1=abs(x-y);
			ll y1=abs(x+y);
			if(x>=x1 && y<=y1)
			{
				count++;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		ll k;
		cin>>a[i];
		// a[i]=abs(k);
	}
	sort(a,a+n);
	int count=0;
	ll x,y,x1,y1;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j < n ; ++j)
		{
			ll m=abs(a[i]);
			ll n=abs(a[j]);
			if(m>n)
			{
				y=m;
				x=n;
			}
			else
			{
				y=n;
				x=m;
			}
			m=abs(a[i]-a[j]);
			n=abs(a[i]+a[j]);
			if(m>n)
			{
				y1=m;
				x1=n;
			}
			else
			{
				y1=n;
				x1=m;
			}
			if(x>=x1 && y<=y1)
			{
				count++;
			}
			if(x1>x)
			{
				break;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int n;
vector <ll> v;
int main()
{

	cin>>n;
	v.assign(n,0);
	for (int i = 0; i < n; ++i)
	{
		cin>>v[i];
		v[i]=abs(v[i]);
	}
	sort(v.begin(),v.end());
	ll count=0;
	for (int i = 0; i < n-1; ++i)
	{
		ll k=2*v[i]+1;
		ll a=lower_bound(v.begin(),v.end(),k)-v.begin();
		a=a-(i+1);
		count+=a;
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	int count=0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j <n ; ++j)
		{
			int x=abs(a[i]);
			int y=abs(a[j]);
			int x1=abs(x-y);
			int y1=abs(x+y);
			if(x>=x1 && y<=y1)
			{
				count++;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	int count=0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j <n ; ++j)
		{
			ll x=abs(a[i]);
			ll y=abs(a[j]);
			ll x1=abs(x-y);
			ll y1=abs(x+y);
			if(x>=x1 && y<=y1)
			{
				count++;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		ll k;
		cin>>k;
		a[i]=abs(k);
	}
	sort(a,a+n);
	int count=0;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j<n ; ++j)
		{
			ll z=abs(a[i]);
			ll h=abs(a[j]);
			ll x,y;
			if(z>h)
			{
				x=h;
				y=z;
			}
			else
			{
				x=z;
				y=h;
			}
			ll x1=abs(x-y);
			ll y1=abs(x+y);
			if(x>=x1 && y<=y1)
			{
				count++;
			}
			if(y-x > x && a[i]>0 && a[j]>0)
			{
				break;
			}
		}
	}
	cout<<count<<"\n";
}


#include<bits/stdc++.h>

using namespace std;
#define mod 998244353;
typedef long long int ll;
#define upto(i,a,b,inc) for(ll i = a; i < b; i=i+inc)
#define downto(i,a,b,dec) for (ll i = a; i >= b;i=i-dec)
#define read(a,n) upto(i,0,n,1) cin>>a[i];
#define show(a,n) upto(i,0,n,1) cout<<a[i]<<" ";
#define MAX 100001
#define INF 1000000001

int main()
{
	int n;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		ll k;
		cin>>a[i];
		// a[i]=abs(k);
	}
	sort(a,a+n);
	int count=0;
	ll x,y,x1,y1;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = i+1; j < n ; ++j)
		{
			ll m=abs(a[i]);
			ll n=abs(a[j]);
			if(m>n)
			{
				y=m;
				x=n;
			}
			else
			{
				y=n;
				x=m;
			}
			m=abs(a[i]-a[j]);
			n=abs(a[i]+a[j]);
			if(m>n)
			{
				y1=m;
				x1=n;
			}
			else
			{
				y1=n;
				x1=m;
			}
			if(x>=x1 && y<=y1)
			{
				count++;
			}
			// if(x1>x)
			// {
			// 	break;
			// }
		}
	}
	cout<<count<<"\n";
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid; int n; long long res;
int main()
{
    ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l++;
            }
            else r--;
        }
        if (f!=0) res+=f;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid,n,res;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    //scanf("%d",&n);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        //scanf("%d",&a[i]);
        cin>>a[i];
        a[i]=abs(a[i]);
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l=mid+1;
            }
            else r=mid-1;
        }
        res+=f;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid,n,res;
int main()
{
    ios_base::sync_with_stdio(false);
    //scanf("%d",&n);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        //scanf("%d",&a[i]);
        cin>>a[i];
        a[i]=abs(a[i]);
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l++;
            }
            else r--;
        }
        res+=f;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],res,r; int n;
int bs(int l,int r,int x)
{
    int f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (2*x>=a[mid])
        {
            f=mid;
            l++;
        }
        else r--;
    }
    return f;
}
int main()
{
    ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        r=bs(l,n,a[l]);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid; int n; long long res;
int main()
{
    ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        int f,mid;
        f=0; l=i+1; r=n;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (a[i]*2>=a[mid])
            {
                f=mid;
                l++;
            }
            else r--;
        }
        if (f!=0) res+=f-i;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid,n;long long res;
int main()
{
    ios_base::sync_with_stdio(false);
    //scanf("%d",&n);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        //scanf("%d",&a[i]);
        cin>>a[i];
        a[i]=abs(a[i]);
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l=mid+1;
            }
            else r=mid-1;
        }
        res+=f;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
long long x,a[200001],r; int n; long long res,l;
int bs(long long l,long long r,long long x)
{
    long long f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (2*x>a[mid])
        {
            f=mid;
            l++;
        }
        else
            if (2*x<a[mid]) r--;
            else return mid;
    }
    return f;
}
int main()
{
    //ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%lli",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    l=1;
    while (l<=n-1)
    {
        r=bs(l+1,n,a[l]);
        if (r!=0) res=res+r-l;
        l++;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r; int n; long long res;
int bs(int l,int r,int x)
{
    int f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (2*x>=a[mid])
        {
            f=mid;
            l++;
        }
        else r--;
    }
    return f;
}
int main()
{
    ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        r=bs(l+1,n,a[l]);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int r,n,x,a[1000001],l; long long res;
int bs(int l,int r,int x)
{
    int f,mid,t;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        int t=a[mid]-x;
        if (x>=t && a[mid]>=t)
        {
            f=mid;
            l++;
        }
        else r--;
    }
    return f;
}
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        x=a[l];
        r=bs(l+1,n,x);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],res,r; int n;
int bs(int l,int r,int x)
{
    int f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (2*x>=a[mid])
        {
            f=mid;
            l++;
        }
        else r--;
    }
    return f;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        r=bs(l+1,n,a[l]);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid,n,res;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    //scanf("%d",&n);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        //scanf("%d",&a[i]);
        cin>>a[i];
        a[i]=abs(a[i]);
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l++;
            }
            else r--;
        }
        res+=f;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid; int n; long long res;
int main()
{
    ios_base::sync_with_stdio(false);
    //scanf("%d",&n);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        //scanf("%d",&a[i]);
        cin>>a[i];
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l++;
            }
            else r--;
        }
        if (f!=0) res+=f;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
long long x,a[200001],r; int n; long long res,l;
int bs(long long l,long long r,long long x)
{
    long long f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (2*x>a[mid])
        {
            f=mid;
            l++;
        }
        else
            if (2*x<a[mid])r--;
            else return mid;
    }
    return f;
}
int main()
{
    //ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    l=1;
    while (l<=n-1)
    {
        r=bs(l+1,n,a[l]);
        if (r!=0) res=res+r-l;
        l++;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
long long x,a[200001],res; long long r; int n;
int bs(int l,long long r,int x)
{
    int f,mid,t;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        int t=a[mid]-x;
        if (x>=t && a[mid]>=t)
        {
            f=mid;
            l++;
        }
        else r--;
    }
    return f;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        r=bs(l+1,n,a[l]);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r; int n; long long res;
int bs(int l,int r,int x)
{
    int f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (2*x>a[mid])
        {
            f=mid;
            l++;
        }
        else
            if (2*x<a[mid])r--;
            else return mid;
    }
    return f;
}
int main()
{
    ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        r=bs(l+1,n,a[l]);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r; int n; long long res;
int bs(int l,int r,int x)
{
    int f,mid;
    f=0;
    while (l<=r)
    {
        mid=(l+r)/2;
        if (x>=a[mid])
        {
            f=mid;
            l++;
        }
        else r--;
    }
    return f;
}
int main()
{
    ios_base::sync_with_stdio(false);
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int l=1;l<=n-1;l++)
    {
        r=bs(l+1,n,a[l]*2);
        if (r!=0) res+=r-l;
    }
    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;
int x,a[200001],r,l,f,mid,n,res;
int main()
{
    ios_base::sync_with_stdio(false);
    //scanf("%d",&n);
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        //scanf("%d",&a[i]);
        cin>>a[i];
        if (a[i]<0) a[i]=-a[i];
    }
    sort(a+1,a+n+1);
    for (int i=1;i<=n-1;i++)
    {
        f=0; l=i+1; r=n; x=a[i]*2;
        while (l<=r)
        {
            mid=(l+r)/2;
            if (x>=a[mid])
            {
                f=mid-i;
                l++;
            }
            else r--;
        }
        res+=f;
    }
    cout<<res;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());
    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();

            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;
            }

        }
        else if(arr[i]==0)
        {
            ll ind=i;
            for(ll j=i;j<n;j++)
            if(arr[j]==0)
            ind=j;
            else
            break;

            ans=ans+ind-i;
        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();

            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;
            }

        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());
    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin()+i,arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=x;

                ans=ans+ind-i;
            }
        }
        else if(arr[i]==0)
        {

        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin()+i,arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=x;

                ans=ans+ind-i;
            }

        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    if(x>0)
    arr.push_back(x);
    else if(x<0)
    arr.push_back(-1*x);
    }

    ll ans=0;
    sort(arr.begin(),arr.end());

    //for(ll i=0;i<arr.size();i++)
    //cout<<arr[i]<<" ";
    //cout<<endl;

    for(ll i=0;i<arr.size();i++)
    {
        ll it=lower_bound(arr.begin(),arr.end(),2*arr[i])-arr.begin();

        if(it==arr.size())
        it--;
        if(arr[it]>2*arr[i])
        it--;

        ll ind=it;
        for(ll j=it;j<arr.size();j++)
        if(arr[j]<=2*arr[i])
        ind=j;
        else
        break;

        //cout<<ind<<endl;
        //cout<<ind<<endl;
        ans=ans+ind-i;
        //cout<<ans<<" ";
    }
    cout<<ans;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());

    ll dp[n+2]={0};
    if(arr[0]==0)
    dp[0]=1;
    for(ll i=1;i<n;i++)
    {
        if(arr[i]==0)
        dp[i]=dp[i-1]+1;
        else
        dp[i]=dp[i-1];
    }

    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();

            if(x==n)
            {
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];

            }
            else if(arr[x]!=num)
            {
                //if(arr[x-1]!=0)
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;
                if(i-1>=0)
                ans=ans-(dp[ind]-dp[i-1]);
                else
                ans=ans-dp[ind];
            }

        }
        else if(arr[i]==0)
        {
            ll ind=i;
            for(ll j=i;j<n;j++)
            if(arr[j]==0)
            ind=j;
            else
            break;

            ans=ans+ind-i;

        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();

            if(x==n)
            {
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];
            }
            else if(arr[x]!=num)
            {
                //if(arr[x-1]!=0)
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;

                if(i-1>=0)
                ans=ans-(dp[ind]-dp[i-1]);
                else
                ans=ans-dp[ind];
            }

        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());
    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ans=ans+x-i;
            }
        }
        else if(arr[i]==0)
        {

        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ans=ans+x-i;
            }
        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());

    ll dp[n+2]={0};
    if(arr[0]==0)
    dp[0]=1;
    for(ll i=1;i<n;i++)
    {
        if(arr[i]==0)
        dp[i]=dp[i-1]+1;
        else
        dp[i]=dp[i-1];
    }

    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();

            if(x==n)
            {
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];

            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;
                if(i-1>=0)
                ans=ans-(dp[ind]-dp[i-1]);
                else
                ans=ans-dp[ind];
            }

        }
        else if(arr[i]==0)
        {
            ll ind=i;
            for(ll j=i;j<n;j++)
            if(arr[j]==0)
            ind=j;
            else
            break;

            ans=ans+ind-i;

        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();

            if(x==n)
            {
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
                if(i-1>=0)
                ans=ans-(dp[x-1]-dp[i-1]);
                else
                ans=ans-dp[x-1];
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;

                if(i-1>=0)
                ans=ans-(dp[ind]-dp[i-1]);
                else
                ans=ans-dp[ind];
            }

        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());
    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;
            }

        }
        else if(arr[i]==0)
        {

        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=j;

                ans=ans+ind-i;
            }

        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin>>n;
    vector<ll> arr;
    for(ll i=0;i<n;i++)
    {
    ll x;
    cin>>x;
    arr.push_back(x);
    }

    sort(arr.begin(),arr.end());
    ll ans=0;
    for(ll i=0;i<n;i++)
    {
        if(arr[i]<0)
        {
            ll num=-2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=x;

                ans=ans+ind-i;
            }

        }
        else if(arr[i]==0)
        {

        }
        else
        {
            ll num=2*arr[i];
            ll x=lower_bound(arr.begin(),arr.end(),num)-arr.begin();
            if(x==n)
            {
                ans=ans+x-1-i;
            }
            else if(arr[x]!=num)
            {
                if(arr[x-1]!=0)
                ans=ans+x-1-i;
            }
            else if(arr[x]==num)
            {
                ll ind=x;
                for(ll j=x;j<n;j++)
                if(arr[j]!=num)
                {
                    break;
                }
                else
                ind=x;

                ans=ans+ind-i;
            }

        }
    }

    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m, x;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(mm[m] == 0) v.push_back(m),mm[m]++;
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        if(v[i] < 0) x = -v[i];
        else x=v[i];

        int pos=lower_bound(v.begin(),v.end(),2LL*x) - v.begin();

        if(pos >= n) pos=n-1;

        if(v[pos] > 2*x || pos>=n) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);

        if(v[i]<0 && mm[x]>=1) res-=1;

        if(mm[0]>=1) res-=1;
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m, x;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        m = abs(m);

        v.pb(m);
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        int pos = upper_bound(v.begin(),v.end(),2*v[i]) - v.begin();

        res += (pos - i - 1);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

void solve()
{
    ll n, m;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(m<0) m=-m;

        v.push_back(m);
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        int pos=lower_bound(v.begin(),v.end(),2LL*v[i]) - v.begin();

        if(pos>=n) pos=n-1;

        if(v[pos] > 2*v[i]) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m, x;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(mm[m] == 0) v.push_back(m),mm[m]++;
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        if(v[i] < 0) x = -v[i];
        else x=v[i];

        int pos=lower_bound(v.begin(),v.end(),2LL*x) - v.begin();

        if(v[pos] > 2*x || pos>=n) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);

        if(v[i]<0 && mm[x]>=1) res-=1;
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

void solve()
{
    ll n, m;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        m=abs(m);

        v.push_back(m);
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n ; i++)
    {
        if(v[i]==0) continue;
        int pos=lower_bound(v.begin(),v.end(),2*v[i]) - v.begin();

        //deb2(v[i] , pos);

        if(pos>=n) pos=n-1;

        if(v[pos] > 2*v[i]) pos--;

        res += (pos-i);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m, x;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(mm[m] == 0) v.push_back(m),mm[m]++;
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        if(v[i] < 0) x = -v[i];
        else x=v[i];

        int pos=lower_bound(v.begin(),v.end(),2LL*x) - v.begin();

        if(v[pos] > 2*x || pos>=n) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);

        if(mm[x] > 1) res--;
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

void solve()
{
    ll n, m;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(m<0) m=abs(m);

        v.push_back(m);
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n ; i++)
    {
        int pos=lower_bound(v.begin(),v.end(),2*v[i]) - v.begin();

        if(pos>=n) pos=n-1;

        if(v[pos] > 2*v[i]) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(m<0) m=-m;

        if(mm[m] == 0) v.push_back(m),mm[m]++;
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        int pos=lower_bound(v.begin(),v.end(),2LL*v[i]) - v.begin();

        if(v[pos] > 2*v[i] || pos>=n) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m, x;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(mm[m] == 0) v.push_back(m),mm[m]++;
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        if(v[i] < 0) x = -v[i];

        else x=v[i];

        int pos=lower_bound(v.begin(),v.end(),2LL*x) - v.begin();

        if(pos >= n) pos=n-1;

        if(v[pos] > 2*x) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);

        //if(v[i]<0 && mm[x]>=1) res-=1;

        if(mm[0]>=1 && v[i]<0) res-=1;
        if(mm[x]>=1 && v[i]<0) res-=1;

        //deb2(v[i] , res);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif


#include<bits/stdc++.h>
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];

map<int,int>mm;

void solve()
{
    ll n, m;

    sl(n);

    ll res=0;

    vl v;

    fo(i,n)
    {
        sl(m);

        if(mm[m] == 0) v.push_back(m),mm[m]++;
    }

    sort(v.begin() , v.end());

    for(int i=0 ; i<n-1 ; i++)
    {
        if(v[i] < 0) v[i] = -v[i];

        int pos=lower_bound(v.begin(),v.end(),2LL*v[i]) - v.begin();

        if(v[pos] > 2*v[i] || pos>=n) pos--;

        //deb2(pos,v[i]);

        res += (pos-i);
    }

    pl(res);
}

int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}

/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}

ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/

//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif