import itertools, bisect

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

ans = 0
for i, j in itertools.combinations(range(N), 2):
    ans += bisect.bisect_left(L, L[i] + L[j]) - j - 1
print(ans) import itertools, bisect itertools bisect N = int(input()) N int(input()) int input() input L = sorted(list(map(int, input().split()))) L sorted(list(map(int, input().split()))) sorted list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i, j in itertools.combinations(range(N), 2):
    ans += bisect.bisect_left(L, L[i] + L[j]) - j - 1 i j itertools.combinations(range(N), 2) itertools.combinations itertools combinations range(N) range N 2 ans += bisect.bisect_left(L, L[i] + L[j]) - j - 1 ans bisect.bisect_left(L, L[i] + L[j]) - j - 1 bisect.bisect_left(L, L[i] + L[j]) - j bisect.bisect_left(L, L[i] + L[j]) bisect.bisect_left bisect bisect_left L L[i] + L[j] L[i] L i L[j] L j j 1 print(ans) print ans ans += bisect.bisect_left(L, L[i] + L[j]) - j - 1 bisect.bisect_left(L, L[i] + L[j]) - j - 1 ans N = int(input()) int(input()) N L = sorted(list(map(int, input().split()))) sorted(list(map(int, input().split()))) L ans = 0 0 ans
import itertools, bisect

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

ans = 0
for i, j in itertools.combinations(range(N), 2):
    ans += bisect.bisect_left(L, L[i] + L[j]) - j - 1
print(ans)
