n = int(input())
L = list(map(int,input().split()))
L.sort()
import bisect
ans = 0
for i in range(1,n):
    for j in range(i+1,n):
        tmp = L[:i]
        v = L[j]-L[i]
        idv = bisect.bisect_right(tmp,v)
        if idv!=len(tmp):
            ans += len(tmp)-idv
print(ans)
 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() L.sort L sort import bisect bisect ans = 0 ans 0 for i in range(1,n):
    for j in range(i+1,n):
        tmp = L[:i]
        v = L[j]-L[i]
        idv = bisect.bisect_right(tmp,v)
        if idv!=len(tmp):
            ans += len(tmp)-idv i range(1,n) range 1 n for j in range(i+1,n):
        tmp = L[:i]
        v = L[j]-L[i]
        idv = bisect.bisect_right(tmp,v)
        if idv!=len(tmp):
            ans += len(tmp)-idv j range(i+1,n) range i+1 i 1 n tmp = L[:i] tmp L[:i] L :i i v = L[j]-L[i] v L[j]-L[i] L[j] L j L[i] L i idv = bisect.bisect_right(tmp,v) idv bisect.bisect_right(tmp,v) bisect.bisect_right bisect bisect_right tmp v if idv!=len(tmp):
            ans += len(tmp)-idv idv!=len(tmp) idv len(tmp) len tmp ans += len(tmp)-idv ans len(tmp)-idv len(tmp) len tmp idv print(ans) print ans ans += len(tmp)-idv len(tmp)-idv ans idv = bisect.bisect_right(tmp,v) bisect.bisect_right(tmp,v) idv n = int(input()) int(input()) n tmp = L[:i] L[:i] tmp L = list(map(int,input().split())) list(map(int,input().split())) L ans = 0 0 ans v = L[j]-L[i] L[j]-L[i] v
n = int(input())
L = list(map(int,input().split()))
L.sort()
import bisect
ans = 0
for i in range(1,n):
    for j in range(i+1,n):
        tmp = L[:i]
        v = L[j]-L[i]
        idv = bisect.bisect_right(tmp,v)
        if idv!=len(tmp):
            ans += len(tmp)-idv
print(ans)

