n = int(input())
import bisect
a = sorted(list(map(int, input().split(" "))))
ans = 0
for i in range(1, n-1):
  b = a[:i]
  c = a[i + 1:]
  #print(b, c)
  for j in b:
    ans += bisect.bisect(c, a[i]+j-0.1)
    #print(bisect.bisect(c, a[i]+j-0.1))
print(ans) n = int(input()) n int(input()) int input() input import bisect bisect a = sorted(list(map(int, input().split(" ")))) a 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(1, n-1):
  b = a[:i]
  c = a[i + 1:]
  #print(b, c)
  for j in b:
    ans += bisect.bisect(c, a[i]+j-0.1)
    #print(bisect.bisect(c, a[i]+j-0.1)) i range(1, n-1) range 1 n-1 n 1 b = a[:i] b a[:i] a :i i c = a[i + 1:] c a[i + 1:] a i + 1: i + 1 i 1 for j in b:
    ans += bisect.bisect(c, a[i]+j-0.1)
    #print(bisect.bisect(c, a[i]+j-0.1)) j b ans += bisect.bisect(c, a[i]+j-0.1) ans bisect.bisect(c, a[i]+j-0.1) bisect.bisect bisect bisect c a[i]+j-0.1 a[i]+j a[i] a i j 0.1 print(ans) print ans a = sorted(list(map(int, input().split(" ")))) sorted(list(map(int, input().split(" ")))) a ans = 0 0 ans b = a[:i] a[:i] b c = a[i + 1:] a[i + 1:] c ans += bisect.bisect(c, a[i]+j-0.1) bisect.bisect(c, a[i]+j-0.1) ans n = int(input()) int(input()) n
n = int(input())
import bisect
a = sorted(list(map(int, input().split(" "))))
ans = 0
for i in range(1, n-1):
  b = a[:i]
  c = a[i + 1:]
  #print(b, c)
  for j in b:
    ans += bisect.bisect(c, a[i]+j-0.1)
    #print(bisect.bisect(c, a[i]+j-0.1))
print(ans)