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

import bisect

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

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

import bisect

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

print(ans)