n = int(input())
l = sorted(map(int, input().split()))
ret = 0
for i in range(n):
    k = i + 2
    for j in range(i + 1, n):
        while k < n and l[i] + l[j] > l[k]:
            k += 1
        ret += k - j - 1
print(ret) 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 ret = 0 ret 0 for i in range(n):
    k = i + 2
    for j in range(i + 1, n):
        while k < n and l[i] + l[j] > l[k]:
            k += 1
        ret += k - j - 1 i range(n) range n k = i + 2 k i + 2 i 2 for j in range(i + 1, n):
        while k < n and l[i] + l[j] > l[k]:
            k += 1
        ret += k - j - 1 j range(i + 1, n) range i + 1 i 1 n while k < n and l[i] + l[j] > l[k]:
            k += 1
         k < n and l[i] + l[j] > l[k] k < n k n l[i] + l[j] > l[k] l[i] + l[j] l[i] l i l[j] l j l[k] l k k += 1 k 1 ret += k - j - 1 ret k - j - 1 k - j k j 1 print(ret) print ret l = sorted(map(int, input().split())) sorted(map(int, input().split())) l n = int(input()) int(input()) n ret = 0 0 ret ret += k - j - 1 k - j - 1 ret k += 1 1 k k = i + 2 i + 2 k
n = int(input())
l = sorted(map(int, input().split()))
ret = 0
for i in range(n):
    k = i + 2
    for j in range(i + 1, n):
        while k < n and l[i] + l[j] > l[k]:
            k += 1
        ret += k - j - 1
print(ret)
