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(input())
A = np.int32(input().split())
A.sort()
print(f(A)) import numpy as np numpy from numba import 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 f N = len(A) N len(A) len A cnt = 0 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])
     i range(N) range N for j in range(i + 1, N):
            for k in range(j + 1, N):
                cnt += (A[k] < A[i] + A[j])
     j range(i + 1, N) range i + 1 i 1 N for k in range(j + 1, N):
                cnt += (A[k] < A[i] + A[j])
     k range(j + 1, N) range j + 1 j 1 N cnt += (A[k] < A[i] + A[j]) cnt A[k] < A[i] + A[j] A[k] A k A[i] + A[j] A[i] A i A[j] A j return cnt cnt A A @njit f njit f N = int(input()) N int(input()) int input() input A = np.int32(input().split()) A np.int32(input().split()) np.int32 np int32 input().split() ().split () input split A.sort() A.sort A sort print(f(A)) print f(A) f A N = int(input()) int(input()) N A = np.int32(input().split()) np.int32(input().split()) A 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 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 f
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(input())
A = np.int32(input().split())
A.sort()
print(f(A))
