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

ans = 0
for i, a in enumerate(L[2:]):
    k = i + 1
    for j, b in enumerate(L[:i + 2]):
        while j < k and a - b < L[k]:
            k -= 1
        ans += i - max(k, j) + 1

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 ans = 0 ans 0 for i, a in enumerate(L[2:]):
    k = i + 1
    for j, b in enumerate(L[:i + 2]):
        while j < k and a - b < L[k]:
            k -= 1
        ans += i - max(k, j) + 1 i a enumerate(L[2:]) enumerate L[2:] L 2: 2 k = i + 1 k i + 1 i 1 for j, b in enumerate(L[:i + 2]):
        while j < k and a - b < L[k]:
            k -= 1
        ans += i - max(k, j) + 1 j b enumerate(L[:i + 2]) enumerate L[:i + 2] L :i + 2 i + 2 i 2 while j < k and a - b < L[k]:
            k -= 1
         j < k and a - b < L[k] j < k j k a - b < L[k] a - b a b L[k] L k k -= 1 k 1 ans += i - max(k, j) + 1 ans i - max(k, j) + 1 i - max(k, j) i max(k, j) max k j 1 print(ans) print ans k -= 1 1 k k = i + 1 i + 1 k ans = 0 0 ans L = list(map(int, input().split())) list(map(int, input().split())) L ans += i - max(k, j) + 1 i - max(k, j) + 1 ans n = int(input()) int(input()) n
n = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0
for i, a in enumerate(L[2:]):
    k = i + 1
    for j, b in enumerate(L[:i + 2]):
        while j < k and a - b < L[k]:
            k -= 1
        ans += i - max(k, j) + 1

print(ans)
