n=int(input())
l=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
  for j in range(i+1,n):
    left=j+1
    right=n
    while left<right:
      mid=(left+right)//2
      if l[mid]>=l[i]+l[j]:
        right=mid
      else:
        left=mid+1
    ans+=right-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 ans=0 ans 0 for i in range(n):
  for j in range(i+1,n):
    left=j+1
    right=n
    while left<right:
      mid=(left+right)//2
      if l[mid]>=l[i]+l[j]:
        right=mid
      else:
        left=mid+1
    ans+=right-j-1 i range(n) range n for j in range(i+1,n):
    left=j+1
    right=n
    while left<right:
      mid=(left+right)//2
      if l[mid]>=l[i]+l[j]:
        right=mid
      else:
        left=mid+1
    ans+=right-j-1 j range(i+1,n) range i+1 i 1 n left=j+1 left j+1 j 1 right=n right n while left<right:
      mid=(left+right)//2
      if l[mid]>=l[i]+l[j]:
        right=mid
      else:
        left=mid+1
     left<right left right mid=(left+right)//2 mid (left+right)//2 left+right left right 2 if l[mid]>=l[i]+l[j]:
        right=mid
      else:
        left=mid+1
     l[mid]>=l[i]+l[j] l[mid] l mid l[i]+l[j] l[i] l i l[j] l j right=mid right mid left=mid+1 left mid+1 mid 1 ans+=right-j-1 ans right-j-1 right-j right j 1 print(ans) print ans mid=(left+right)//2 (left+right)//2 mid right=mid mid right ans+=right-j-1 right-j-1 ans left=j+1 j+1 left left=mid+1 mid+1 left right=n n right l=sorted(list(map(int,input().split()))) sorted(list(map(int,input().split()))) l n=int(input()) int(input()) n ans=0 0 ans
n=int(input())
l=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
  for j in range(i+1,n):
    left=j+1
    right=n
    while left<right:
      mid=(left+right)//2
      if l[mid]>=l[i]+l[j]:
        right=mid
      else:
        left=mid+1
    ans+=right-j-1
print(ans)