N=int(input())
L=list(map(int,input().split()))
from bisect import bisect_right as br
from bisect import bisect_left as bl

L.sort()

res=0
for i in range(N):
    for j in range(N):
        if not i<j:
            continue
        m=abs(L[i]-L[j])
        M=L[i]+L[j]
        r=bl(L,M)-br(L,m)
        if m<L[i]<M:
            r-=1
        if m<L[j]<M:
            r-=1
        res+=r
print(res//3) 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 from bisect import bisect_right as br from bisect import bisect_left as bl L.sort() L.sort L sort res=0 res 0 for i in range(N):
    for j in range(N):
        if not i<j:
            continue
        m=abs(L[i]-L[j])
        M=L[i]+L[j]
        r=bl(L,M)-br(L,m)
        if m<L[i]<M:
            r-=1
        if m<L[j]<M:
            r-=1
        res+=r i range(N) range N for j in range(N):
        if not i<j:
            continue
        m=abs(L[i]-L[j])
        M=L[i]+L[j]
        r=bl(L,M)-br(L,m)
        if m<L[i]<M:
            r-=1
        if m<L[j]<M:
            r-=1
        res+=r j range(N) range N if not i<j:
            continue
         not i<j i<j i j continue m=abs(L[i]-L[j]) m abs(L[i]-L[j]) abs L[i]-L[j] L[i] L i L[j] L j M=L[i]+L[j] M L[i]+L[j] L[i] L i L[j] L j r=bl(L,M)-br(L,m) r bl(L,M)-br(L,m) bl(L,M) bl L M br(L,m) br L m if m<L[i]<M:
            r-=1
         m<L[i]<M m<L[i] m L[i] L i M r-=1 r 1 if m<L[j]<M:
            r-=1
         m<L[j]<M m<L[j] m L[j] L j M r-=1 r 1 res+=r res r print(res//3) print res//3 res 3 m=abs(L[i]-L[j]) abs(L[i]-L[j]) m r-=1 1 r r=bl(L,M)-br(L,m) bl(L,M)-br(L,m) r res+=r r res N=int(input()) int(input()) N r-=1 1 r res=0 0 res L=list(map(int,input().split())) list(map(int,input().split())) L M=L[i]+L[j] L[i]+L[j] M
N=int(input())
L=list(map(int,input().split()))
from bisect import bisect_right as br
from bisect import bisect_left as bl

L.sort()

res=0
for i in range(N):
    for j in range(N):
        if not i<j:
            continue
        m=abs(L[i]-L[j])
        M=L[i]+L[j]
        r=bl(L,M)-br(L,m)
        if m<L[i]<M:
            r-=1
        if m<L[j]<M:
            r-=1
        res+=r
print(res//3)