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

L.sort()
from bisect import*
i=0
ans=0
while i<N:
    j=i+1
    while j<N:
        ans+=bisect_left(L,L[i]+L[j])-j-1
        j+=1
    i+=1

print(ans) N=int(input()) N int(input()) int input() input *L,=map(int,input().split()) *L L map(int,input().split()) map int input().split() ().split () input split L.sort() L.sort L sort from bisect import* i=0 i 0 ans=0 ans 0 while i<N:
    j=i+1
    while j<N:
        ans+=bisect_left(L,L[i]+L[j])-j-1
        j+=1
    i+=1 i<N i N j=i+1 j i+1 i 1 while j<N:
        ans+=bisect_left(L,L[i]+L[j])-j-1
        j+=1
     j<N j N ans+=bisect_left(L,L[i]+L[j])-j-1 ans bisect_left(L,L[i]+L[j])-j-1 bisect_left(L,L[i]+L[j])-j bisect_left(L,L[i]+L[j]) bisect_left L L[i]+L[j] L[i] L i L[j] L j j 1 j+=1 j 1 i+=1 i 1 print(ans) print ans i=0 0 i i+=1 1 i j+=1 1 j N=int(input()) int(input()) N ans=0 0 ans j=i+1 i+1 j ans+=bisect_left(L,L[i]+L[j])-j-1 bisect_left(L,L[i]+L[j])-j-1 ans
N=int(input())
*L,=map(int,input().split())

L.sort()
from bisect import*
i=0
ans=0
while i<N:
    j=i+1
    while j<N:
        ans+=bisect_left(L,L[i]+L[j])-j-1
        j+=1
    i+=1

print(ans)
