n = int(input())
l = sorted(map(int, input().split()))
cnt = 0
m = n-1
g = []
for i in range(n):
  for j in range(i):
    g.append(l[i]+l[j])
g = sorted(g,reverse = True)
for i in g:
  while l[m] >= i:
    m-=1
  cnt += n-m-1
print(n*(n-1)*(n-2)//6-cnt) n = int(input()) n int(input()) int input() input l = sorted(map(int, input().split())) l sorted(map(int, input().split())) sorted map(int, input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 m = n-1 m n-1 n 1 g = [] g [] for i in range(n):
  for j in range(i):
    g.append(l[i]+l[j]) i range(n) range n for j in range(i):
    g.append(l[i]+l[j]) j range(i) range i g.append(l[i]+l[j]) g.append g append l[i]+l[j] l[i] l i l[j] l j g = sorted(g,reverse = True) g sorted(g,reverse = True) sorted g reverse = True reverse True for i in g:
  while l[m] >= i:
    m-=1
  cnt += n-m-1 i g while l[m] >= i:
    m-=1
   l[m] >= i l[m] l m i m-=1 m 1 cnt += n-m-1 cnt n-m-1 n-m n m 1 print(n*(n-1)*(n-2)//6-cnt) print n*(n-1)*(n-2)//6-cnt n*(n-1)*(n-2)//6 n*(n-1)*(n-2) n*(n-1) n n-1 n 1 n-2 n 2 6 cnt g = [] [] g n = int(input()) int(input()) n m = n-1 n-1 m l = sorted(map(int, input().split())) sorted(map(int, input().split())) l cnt = 0 0 cnt g = sorted(g,reverse = True) sorted(g,reverse = True) g m-=1 1 m cnt += n-m-1 n-m-1 cnt
n = int(input())
l = sorted(map(int, input().split()))
cnt = 0
m = n-1
g = []
for i in range(n):
  for j in range(i):
    g.append(l[i]+l[j])
g = sorted(g,reverse = True)
for i in g:
  while l[m] >= i:
    m-=1
  cnt += n-m-1
print(n*(n-1)*(n-2)//6-cnt)