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

L.sort()
from bisect import*
i=0
ans=0
for i in range(N-1):
    for j in range(i+1,N):
        ans+=bisect_left(L,L[i]+L[j])-j-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 for i in range(N-1):
    for j in range(i+1,N):
        ans+=bisect_left(L,L[i]+L[j])-j-1 i range(N-1) range N-1 N 1 for j in range(i+1,N):
        ans+=bisect_left(L,L[i]+L[j])-j-1 j range(i+1,N) range i+1 i 1 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 print(ans) print ans ans=0 0 ans ans+=bisect_left(L,L[i]+L[j])-j-1 bisect_left(L,L[i]+L[j])-j-1 ans i=0 0 i N=int(input()) int(input()) N
N=int(input())
*L,=map(int,input().split())

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

print(ans)