import math

def canMakeTriangle(a, b, c):
    return abs(b - c) < a

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

res = 0
for i in range(1, N):
    for j in range(i + 1, N):
        a = 0
        b = i
        c = 0
        while b - a >= 1:
            c = (a + b) / 2
            if canMakeTriangle(L[math.floor(c)], L[i], L[j]):
                b = c
            else:
                a = c

        c = math.floor(c)

        if canMakeTriangle(L[c], L[i], L[j]):
            res += i - c
        else:
            res += i - c - 1

print(res) import math math def canMakeTriangle(a, b, c):
    return abs(b - c) < a canMakeTriangle return abs(b - c) < a abs(b - c) < a abs(b - c) abs b - c b c a a a b b c c 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 res = 0 res 0 for i in range(1, N):
    for j in range(i + 1, N):
        a = 0
        b = i
        c = 0
        while b - a >= 1:
            c = (a + b) / 2
            if canMakeTriangle(L[math.floor(c)], L[i], L[j]):
                b = c
            else:
                a = c

        c = math.floor(c)

        if canMakeTriangle(L[c], L[i], L[j]):
            res += i - c
        else:
            res += i - c - 1 i range(1, N) range 1 N for j in range(i + 1, N):
        a = 0
        b = i
        c = 0
        while b - a >= 1:
            c = (a + b) / 2
            if canMakeTriangle(L[math.floor(c)], L[i], L[j]):
                b = c
            else:
                a = c

        c = math.floor(c)

        if canMakeTriangle(L[c], L[i], L[j]):
            res += i - c
        else:
            res += i - c - 1 j range(i + 1, N) range i + 1 i 1 N a = 0 a 0 b = i b i c = 0 c 0 while b - a >= 1:
            c = (a + b) / 2
            if canMakeTriangle(L[math.floor(c)], L[i], L[j]):
                b = c
            else:
                a = c

         b - a >= 1 b - a b a 1 c = (a + b) / 2 c (a + b) / 2 a + b a b 2 if canMakeTriangle(L[math.floor(c)], L[i], L[j]):
                b = c
            else:
                a = c

         canMakeTriangle(L[math.floor(c)], L[i], L[j]) canMakeTriangle L[math.floor(c)] L math.floor(c) math.floor math floor c L[i] L i L[j] L j b = c b c a = c a c c = math.floor(c) c math.floor(c) math.floor math floor c if canMakeTriangle(L[c], L[i], L[j]):
            res += i - c
        else:
            res += i - c - 1 canMakeTriangle(L[c], L[i], L[j]) canMakeTriangle L[c] L c L[i] L i L[j] L j res += i - c res i - c i c res += i - c - 1 res i - c - 1 i - c i c 1 print(res) print res L = list(map(int, input().split())) list(map(int, input().split())) L b = c c b res += i - c - 1 i - c - 1 res c = (a + b) / 2 (a + b) / 2 c a = c c a res = 0 0 res N = int(input()) int(input()) N a = 0 0 a def canMakeTriangle(a, b, c):
    return abs(b - c) < a def canMakeTriangle(a, b, c):
    return abs(b - c) < a canMakeTriangle c = 0 0 c b = i i b res += i - c i - c res c = math.floor(c) math.floor(c) c
import math

def canMakeTriangle(a, b, c):
    return abs(b - c) < a

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

res = 0
for i in range(1, N):
    for j in range(i + 1, N):
        a = 0
        b = i
        c = 0
        while b - a >= 1:
            c = (a + b) / 2
            if canMakeTriangle(L[math.floor(c)], L[i], L[j]):
                b = c
            else:
                a = c

        c = math.floor(c)

        if canMakeTriangle(L[c], L[i], L[j]):
            res += i - c
        else:
            res += i - c - 1

print(res)