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

L.sort(reverse=True)
counter = 0
import bisect

for index1,c in enumerate(L):
    for index2,b in enumerate(L[index1+1:],start=index1+1):
        left = 0 ; right = N
        oppai = c-b
        while left+1<right:
            mid = (left+right)//2
            if L[mid]>oppai:
                left = mid
            else :
                right=mid
        
        index3 = left
        
        if index3>index2:

            counter += index3-index2
print(counter) N = int(input()) N int(input()) int input() input L = list(map(int,input().split())) L list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split L.sort(reverse=True) L.sort L sort reverse=True reverse True counter = 0 counter 0 import bisect bisect for index1,c in enumerate(L):
    for index2,b in enumerate(L[index1+1:],start=index1+1):
        left = 0 ; right = N
        oppai = c-b
        while left+1<right:
            mid = (left+right)//2
            if L[mid]>oppai:
                left = mid
            else :
                right=mid
        
        index3 = left
        
        if index3>index2:

            counter += index3-index2 index1 c enumerate(L) enumerate L for index2,b in enumerate(L[index1+1:],start=index1+1):
        left = 0 ; right = N
        oppai = c-b
        while left+1<right:
            mid = (left+right)//2
            if L[mid]>oppai:
                left = mid
            else :
                right=mid
        
        index3 = left
        
        if index3>index2:

            counter += index3-index2 index2 b enumerate(L[index1+1:],start=index1+1) enumerate L[index1+1:] L index1+1: index1+1 index1 1 start=index1+1 start index1+1 index1 1 left = 0 left 0 right = N right N oppai = c-b oppai c-b c b while left+1<right:
            mid = (left+right)//2
            if L[mid]>oppai:
                left = mid
            else :
                right=mid
        
         left+1<right left+1 left 1 right mid = (left+right)//2 mid (left+right)//2 left+right left right 2 if L[mid]>oppai:
                left = mid
            else :
                right=mid
        
         L[mid]>oppai L[mid] L mid oppai left = mid left mid right=mid right mid index3 = left index3 left if index3>index2:

            counter += index3-index2 index3>index2 index3 index2 counter += index3-index2 counter index3-index2 index3 index2 print(counter) print counter right=mid mid right index3 = left left index3 counter = 0 0 counter counter += index3-index2 index3-index2 counter left = 0 0 left N = int(input()) int(input()) N oppai = c-b c-b oppai L = list(map(int,input().split())) list(map(int,input().split())) L right = N N right mid = (left+right)//2 (left+right)//2 mid left = mid mid left
N = int(input())
L = list(map(int,input().split()))

L.sort(reverse=True)
counter = 0
import bisect

for index1,c in enumerate(L):
    for index2,b in enumerate(L[index1+1:],start=index1+1):
        left = 0 ; right = N
        oppai = c-b
        while left+1<right:
            mid = (left+right)//2
            if L[mid]>oppai:
                left = mid
            else :
                right=mid
        
        index3 = left
        
        if index3>index2:

            counter += index3-index2
print(counter)