import numpy as np

from numba import njit

 



@njit

def f(A):

    N = len(A)

    cnt = 0

    

    for i in range(N):

        for j in range(i + 1, N):

            for k in range(j + 1, N):

                cnt += (A[k] < A[i] + A[j])

    return cnt





N = int(eval(input()))

A = np.int32(input().split())

A.sort()

print((f(A)))

import numpy as np

from numba import njit

 



@njit

def f(A):

    n = len(a)

    cnt = 0

    

    for i in range(n):

        for j in range(i + 1, n):

            for k in range(j + 1, n):

                cnt += (A[k] < A[i] + A[j])

    return cnt





n = int(eval(input()))

a = np.array(input().split(), dtype=np.int32)

a.sort()

print((f(a)))

import numpy as np
from numba import njit


@njit
def f(A):
    N = len(A)
    cnt = 0
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                cnt += A[k] < A[i] + A[j]
    return cnt


N = int(eval(input()))
A = np.int32(input().split())
A.sort()
print((f(A)))

import numpy as np
from numba import njit


@njit
def f(A):
    n = len(a)
    cnt = 0
    for i in range(n):
        for j in range(i + 1, n):
            for k in range(j + 1, n):
                cnt += A[k] < A[i] + A[j]
    return cnt


n = int(eval(input()))
a = np.array(input().split(), dtype=np.int32)
a.sort()
print((f(a)))

-    N = len(A) +    n = len(a) -    for i in range(N): -        for j in range(i + 1, N): -            for k in range(j + 1, N): +    for i in range(n): +        for j in range(i + 1, n): +            for k in range(j + 1, n): -N = int(eval(input())) -A = np.int32(input().split()) -A.sort() -print((f(A))) +n = int(eval(input())) +a = np.array(input().split(), dtype=np.int32) +a.sort() +print((f(a)))