n = int(input())
m = list(map(int,input().split()))
m.sort()

ans = 0
for i in range(n):
    for j in range(i+1,n):
        l = j
        r = n
        while r-l>1:
            mid = (r+l)//2
            if m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i]:
                l = mid
            else:
                r = mid
        ans += l-j

print(ans) n = int(input()) n int(input()) int input() input m = list(map(int,input().split())) m list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split m.sort() m.sort m sort ans = 0 ans 0 for i in range(n):
    for j in range(i+1,n):
        l = j
        r = n
        while r-l>1:
            mid = (r+l)//2
            if m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i]:
                l = mid
            else:
                r = mid
        ans += l-j i range(n) range n for j in range(i+1,n):
        l = j
        r = n
        while r-l>1:
            mid = (r+l)//2
            if m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i]:
                l = mid
            else:
                r = mid
        ans += l-j j range(i+1,n) range i+1 i 1 n l = j l j r = n r n while r-l>1:
            mid = (r+l)//2
            if m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i]:
                l = mid
            else:
                r = mid
         r-l>1 r-l r l 1 mid = (r+l)//2 mid (r+l)//2 r+l r l 2 if m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i]:
                l = mid
            else:
                r = mid
         m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i] m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] m[mid] < m[i]+m[j] m[mid] m mid m[i]+m[j] m[i] m i m[j] m j m[i] < m[mid]+m[j] m[i] m i m[mid]+m[j] m[mid] m mid m[j] m j m[j] < m[mid]+m[i] m[j] m j m[mid]+m[i] m[mid] m mid m[i] m i l = mid l mid r = mid r mid ans += l-j ans l-j l j print(ans) print ans ans += l-j l-j ans m = list(map(int,input().split())) list(map(int,input().split())) m n = int(input()) int(input()) n l = j j l l = mid mid l mid = (r+l)//2 (r+l)//2 mid r = n n r r = mid mid r ans = 0 0 ans
n = int(input())
m = list(map(int,input().split()))
m.sort()

ans = 0
for i in range(n):
    for j in range(i+1,n):
        l = j
        r = n
        while r-l>1:
            mid = (r+l)//2
            if m[mid] < m[i]+m[j] and m[i] < m[mid]+m[j] and m[j] < m[mid]+m[i]:
                l = mid
            else:
                r = mid
        ans += l-j

print(ans)