The legend of the foundation of Vectorland talks of two integers $x$ and $y$. Centuries ago, the array king placed two markers at points $|x|$ and $|y|$ on the number line and conquered all the land in between (including the endpoints), which he declared to be Arrayland. Many years later, the vector king placed markers at points $|x - y|$ and $|x + y|$ and conquered all the land in between (including the endpoints), which he declared to be Vectorland. He did so in such a way that the land of Arrayland was completely inside (including the endpoints) the land of Vectorland.

Here $|z|$ denotes the absolute value of $z$.

Now, Jose is stuck on a question of his history exam: "What are the values of $x$ and $y$?" Jose doesn't know the answer, but he believes he has narrowed the possible answers down to $n$ integers $a_1, a_2, \dots, a_n$. Now, he wants to know the number of unordered pairs formed by two different elements from these $n$ integers such that the legend could be true if $x$ and $y$ were equal to these two values. Note that it is possible that Jose is wrong, and that no pairs could possibly make the legend true.


-----Input-----

The first line contains a single integer $n$ ($2 \le n \le 2 \cdot 10^5$)  — the number of choices.

The second line contains $n$ pairwise distinct integers $a_1, a_2, \dots, a_n$ ($-10^9 \le a_i \le 10^9$) — the choices Jose is considering.


-----Output-----

Print a single integer number — the number of unordered pairs $\{x, y\}$ formed by different numbers from Jose's choices that could make the legend true.


-----Examples-----
Input
3
2 5 -3

Output
2

Input
2
3 6

Output
1



-----Note-----

Consider the first sample. For the pair $\{2, 5\}$, the situation looks as follows, with the Arrayland markers at $|2| = 2$ and $|5| = 5$, while the Vectorland markers are located at $|2 - 5| = 3$ and $|2 + 5| = 7$:

 [Image] 

The legend is not true in this case, because the interval $[2, 3]$ is not conquered by Vectorland. For the pair $\{5, -3\}$ the situation looks as follows, with Arrayland consisting of the interval $[3, 5]$ and Vectorland consisting of the interval $[2, 8]$:

 [Image] 

As Vectorland completely contains Arrayland, the legend is true. It can also be shown that the legend is true for the pair $\{2, -3\}$, for a total of two pairs.

In the second sample, the only pair is $\{3, 6\}$, and the situation looks as follows:

 [Image] 

Note that even though Arrayland and Vectorland share $3$ as endpoint, we still consider Arrayland to be completely inside of Vectorland.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
nums = (abs(int(x)) for x in input().split())
nums = list(sorted(nums))
left = 0
right = 0
ans = 0
while left < n:
    while right < n and nums[right] <= 2 * nums[left]:
        right += 1
    ans += right - left - 1
    left += 1
print(ans)

n=int(input())
A=list(map(int,input().split()))

A=[abs(a) for a in A]
A.sort()

j=0
ANS=0


for i in range(n-1):
    while j<n-1 and A[j+1]-A[i]<=A[i]:
        j+=1

    ANS+=(j-i)

print(ANS)


from collections import defaultdict as dd
import math
def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return list(map(int, input().split()))

def lm():
	return list(map(int, input().split()))



n=nn()
vals=lm()

avals=[abs(v) for v in vals]

avals.sort()



total=0

start=0

end=1


while end<n:

	if 2*avals[start]>=avals[end]:
		end+=1


	else:
		

		total=total+max(0,end-start-1)
		start+=1


num=end-start

total+=num*(num-1)//2


print(total)













n = int(input())
l = sorted([abs(int(i)) for i in input().split()])
ans = 0
i, j = 0, 0

while i < n:
	while j < n and l[i] + l[i] >= l[j]:
		j += 1
	ans += j - i - 1
	i += 1

print(ans)

n=int(input())
l1=list(map(int,input().split()))
l2=[]
for i in range(0,n):
    if l1[i]!=0:
        l2.append(abs(l1[i]))
import bisect
l2.sort()
ans=0
for i in range(0,len(l2)):
    x=bisect.bisect_right(l2,2*l2[i],0,len(l2))
    ans+=(x-i-1)
print(ans)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))

from bisect import bisect_right

n = getN()
nums = [abs(i) for i in getList()]
nums.sort(reverse=False)
ans = 0
#print(nums)
for i , num in enumerate(nums):
    ans += bisect_right(nums, num*2) - i - 1

print(ans )


import bisect
n = int(input())
a = list(map(int, input().split()))
a = [abs(i) for i in a]
a.sort()
ans = 0
for i in range(len(a)):
    right = a[i]*2
    ans += bisect.bisect_right(a, right) - (i+1)


print(ans)


n = int(input())
l = list(map(int,input().split()))
a = [abs(l[i]) for i in range(n)]
a.sort()
wyn = 0
wsk1 = 0
wsk2 = 1
licz = 0
while True:
	if a[wsk1] * 2 < a[wsk2]:
		wyn += (wsk2-wsk1-1)
		wsk1 += 1
	else:
		wsk2 += 1
	if wsk2 == n:
		break
wyn += (n-wsk1)*(n-wsk1-1)//2
print(wyn)

N = int(input())
A = sorted([abs(int(a)) for a in input().split()])

i = 0
j = 1
ans = 0
while j < N:
    while j < N-1 and A[j+1] <= A[i] * 2:
        j += 1
    if A[j] <= A[i] * 2:
        ans += j - i
    i += 1
    if j == i:
        j += 1

print(ans)


n = int(input())
a = list(map(int,input().split()))
a = sorted([abs(x) for x in a])


total = 0
i = 0
for j,h in enumerate(a[:-1]):
    h *= 2
    while i<(n-1) and a[i+1]<=h:
        i+=1
    total += i-j
print (total)




n = int(input())
a = list(map(int, input().split()))

a = sorted(map(abs, a))

#print(a)
ans = 0
j = 1
for i in range(n):
    while j < n and a[j] - a[i] <= a[i]:
        j += 1
    #print(i, j)
    ans += j - i - 1
print(ans)


from collections import deque

n = int(input().strip())
nums = list(map(int, input().strip().split()))
nums = sorted([abs(num) for num in nums], reverse=True)

res = 0
max_index = 0
curr_index = 1
for curr_index in range(1, n):
    while nums[curr_index] * 2 < nums[max_index]:
        max_index += 1
    res += curr_index - max_index
print(res)

def main():
    n = int(input())
    a = sorted(map(abs, list(map(int, input().split()))))
    i = 0
    res = 0
    for j in range(n):
        while a[i] * 2 < a[j]:
            i += 1
        res += j - i
    print(res)


main()


import bisect

def main():
    n = int(input())
    pts = list(map(int,input().split()))
    points = []
    for i in range(n):
        points.append(abs(pts[i]))

    points.sort()
    #print(points)
    pairs = 0

    for i in range(n):
        x = points[i]
        index = bisect.bisect(points,2*x)-1
        #print(x,index)
        if points[index] <= 2*x:
            if index >= i:
                pairs += index-i

    print(pairs)
        


main()


n=int(input())
a=sorted([int(x) for x in input().split()])
counter=0
answer=0
end=1
for i in range(n):
    if a[i]<0:
        a[i]=a[i]*(-1)
a.sort()
for i in range(n):
    end=max(end,i+1)
    for j in range(end,n):
        if a[i]*2<a[j]:
            end=j
            break
        else:
            counter+=1
    else:
        end=j+1
    answer+=counter
    counter=max(counter-1,0)
            
print(answer)
                


'''input
2
3 6
'''
from sys import stdin, setrecursionlimit
from bisect import bisect_right
import math
setrecursionlimit(15000)


# main starts
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
for i in range(n):
	arr[i] = abs(arr[i])
arr.sort()
count = 0
for i in range(n):
	index = bisect_right(arr, arr[i] * 2)
	count += index - i - 1
print(count) 


from bisect import bisect_right
n = int(input())
A = list(map(int, input().split()))
for i in range(len(A)):
    A[i] = abs(A[i])
A.sort()
cnt = 0
for i in range(len(A)):
    q = 2 * A[i]
    j = bisect_right(A, q)
    cnt += max(0, j - i - 1)
print(cnt)

n = int(input())

L = sorted([abs(int(x)) for x in input().split()])

T = 0

for i in range(n-1):
    l,h = i,n-1
    while h != l:
        if L[(l+h+1)//2] <= 2*L[i]:
            l = (l+h+1)//2
        else:
            h = (l+h)//2
    T += l-i

print(T)

n = int(input())
ls = list(map(int, input().split()))
ls = [abs(i) for i in ls]
ls.sort()
i = 0
j = 1
res = []
try:
    while True:
        while ls[j]<=2*ls[i]: j+=1
        res.append(j-i-1)
        i+=1
except:
    while i!=n:
        res.append(j-i-1)
        i+=1
print(sum(res))


# stdin=open('input.txt')
from sys import stdin, stdout
def input():
	return stdin.readline()[:-1]


# stdout=open('output.txt',mode='w+')

# def print(x, end='\n'):
# 	stdout.write(str(x) +end)


# a, b = map(int, input().split())

# l = list(map(int, input().split()))

# n = int(input())





# CODE BEGINS HERE.................

# import copy
import math
# import sys
# sys.setrecursionlimit(10**7)
def abs_int(a):
	return abs(int(a))

n = int(input())
a = list(map(abs_int, input().split()))

a.sort()
# print(a)

ptr = 0
half = -1
gt_than_half = [0] * n
for i in range(n):
	half = math.ceil(a[i]/2)
	while a[ptr] < half:
		ptr += 1
	gt_than_half[i] = i - ptr
# print(gt_than_half)

a.reverse()
# print(a)

ptr = 0
twice = -1
lt_than_twice = [0] * n
for i in range(n):
	twice = 2 * a[i]
	while a[ptr] > twice:
		ptr += 1
	lt_than_twice[i] = i - ptr
# print(lt_than_twice)

print((sum(gt_than_half) + sum(lt_than_twice))//2)


#CODE ENDS HERE....................


#stdout.close()



N = int(input())
A = list(map(int, input().split()))

def count(X, Y):
    res = 0
    r = 0
    r2 = 0
    Y = [-10**10] + Y + [10**10]
    for l in range(len(X)):
        xl = X[l]
        for _ in range(len(Y)):
            if Y[r+1] <= 2*xl:
                r += 1
                continue
            break
        for _ in range(len(Y)):
            if Y[r2+1] < xl:
                r2 += 1
                continue
            break
        res += max(0, r - r2)
    return res

AP = [a for a in A if a > 0]
AP.sort()
AN = [-a for a in A if a < 0]
AN.sort()
print(count(AP, AP) + count(AP, AN) + count(AN, AP) + count(AN, AN) - len(AN) - len(AP) - len(set(AP) & set(AN)))