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