n = int(input())
l = list(map(int,input().split()))+[0]
l.sort(reverse=True)
ans = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        left = j
        right = n
        while right - left > 1:
            middle = (left + right)//2
            if l[i]-l[j] < l[middle]:
                left = middle
            else:
                right = middle
        ans += (left-j)
print(ans) n = int(input()) n int(input()) int input() input l = list(map(int,input().split()))+[0] l list(map(int,input().split()))+[0] list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split [0] 0 l.sort(reverse=True) l.sort l sort reverse=True reverse True ans = 0 ans 0 for i in range(n-2):
    for j in range(i+1,n-1):
        left = j
        right = n
        while right - left > 1:
            middle = (left + right)//2
            if l[i]-l[j] < l[middle]:
                left = middle
            else:
                right = middle
        ans += (left-j) i range(n-2) range n-2 n 2 for j in range(i+1,n-1):
        left = j
        right = n
        while right - left > 1:
            middle = (left + right)//2
            if l[i]-l[j] < l[middle]:
                left = middle
            else:
                right = middle
        ans += (left-j) j range(i+1,n-1) range i+1 i 1 n-1 n 1 left = j left j right = n right n while right - left > 1:
            middle = (left + right)//2
            if l[i]-l[j] < l[middle]:
                left = middle
            else:
                right = middle
         right - left > 1 right - left right left 1 middle = (left + right)//2 middle (left + right)//2 left + right left right 2 if l[i]-l[j] < l[middle]:
                left = middle
            else:
                right = middle
         l[i]-l[j] < l[middle] l[i]-l[j] l[i] l i l[j] l j l[middle] l middle left = middle left middle right = middle right middle ans += (left-j) ans left-j left j print(ans) print ans left = middle middle left ans = 0 0 ans right = middle middle right middle = (left + right)//2 (left + right)//2 middle n = int(input()) int(input()) n l = list(map(int,input().split()))+[0] list(map(int,input().split()))+[0] l right = n n right left = j j left ans += (left-j) left-j ans
n = int(input())
l = list(map(int,input().split()))+[0]
l.sort(reverse=True)
ans = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        left = j
        right = n
        while right - left > 1:
            middle = (left + right)//2
            if l[i]-l[j] < l[middle]:
                left = middle
            else:
                right = middle
        ans += (left-j)
print(ans)