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

L = sorted(L)

import bisect

count = 0
for i in range (0, len(L)-2):
	for j in range (i+1, len(L)-1):
		count+= bisect.bisect_left(L[j+1:], L[i]+L[j])

print(count) 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 = sorted(L) L sorted(L) sorted L import bisect bisect count = 0 count 0 for i in range (0, len(L)-2):
	for j in range (i+1, len(L)-1):
		count+= bisect.bisect_left(L[j+1:], L[i]+L[j]) i range (0, len(L)-2) range 0 len(L)-2 len(L) len L 2 for j in range (i+1, len(L)-1):
		count+= bisect.bisect_left(L[j+1:], L[i]+L[j]) j range (i+1, len(L)-1) range i+1 i 1 len(L)-1 len(L) len L 1 count+= bisect.bisect_left(L[j+1:], L[i]+L[j]) count bisect.bisect_left(L[j+1:], L[i]+L[j]) bisect.bisect_left bisect bisect_left L[j+1:] L j+1: j+1 j 1 L[i]+L[j] L[i] L i L[j] L j print(count) print count N = int(input()) int(input()) N L = sorted(L) sorted(L) L count = 0 0 count count+= bisect.bisect_left(L[j+1:], L[i]+L[j]) bisect.bisect_left(L[j+1:], L[i]+L[j]) count L = list(map(int, input().split())) list(map(int, input().split())) L
N = int(input())
L = list(map(int, input().split()))

L = sorted(L)

import bisect

count = 0
for i in range (0, len(L)-2):
	for j in range (i+1, len(L)-1):
		count+= bisect.bisect_left(L[j+1:], L[i]+L[j])

print(count)