# ABC172 Making Triangle
N = int(input())
L = list(map(int,input().split()))
d = {i:L.count(i) for i in L}

L = sorted(list(set(L)))
num = len(L)
ans = 0

for i in range(num-2):
    for j in range(i+1,num-1):
        for k in range(j+1,num):
            if L[k] < L[i] + L[j]:
                ans += d[L[k]]*d[L[i]]*d[L[j]]
            else:
                break
print(ans) N = int(input()) N int(input()) int input() input L = list(map(int,input().split())) L list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split i:L.count(i) for i in L for i in L i L for i in L i L.count(i) L.count L count i d = {i:L.count(i) for i in L} d {i:L.count(i) for i in L} L = sorted(list(set(L))) L sorted(list(set(L))) sorted list(set(L)) list set(L) set L num = len(L) num len(L) len L ans = 0 ans 0 for i in range(num-2):
    for j in range(i+1,num-1):
        for k in range(j+1,num):
            if L[k] < L[i] + L[j]:
                ans += d[L[k]]*d[L[i]]*d[L[j]]
            else:
                break i range(num-2) range num-2 num 2 for j in range(i+1,num-1):
        for k in range(j+1,num):
            if L[k] < L[i] + L[j]:
                ans += d[L[k]]*d[L[i]]*d[L[j]]
            else:
                break j range(i+1,num-1) range i+1 i 1 num-1 num 1 for k in range(j+1,num):
            if L[k] < L[i] + L[j]:
                ans += d[L[k]]*d[L[i]]*d[L[j]]
            else:
                break k range(j+1,num) range j+1 j 1 num if L[k] < L[i] + L[j]:
                ans += d[L[k]]*d[L[i]]*d[L[j]]
            else:
                break L[k] < L[i] + L[j] L[k] L k L[i] + L[j] L[i] L i L[j] L j ans += d[L[k]]*d[L[i]]*d[L[j]] ans d[L[k]]*d[L[i]]*d[L[j]] d[L[k]]*d[L[i]] d[L[k]] d L[k] L k d[L[i]] d L[i] L i d[L[j]] d L[j] L j break print(ans) print ans num = len(L) len(L) num N = int(input()) int(input()) N ans += d[L[k]]*d[L[i]]*d[L[j]] d[L[k]]*d[L[i]]*d[L[j]] ans d = {i:L.count(i) for i in L} {i:L.count(i) for i in L} d ans = 0 0 ans L = list(map(int,input().split())) list(map(int,input().split())) L L = sorted(list(set(L))) sorted(list(set(L))) L
# ABC172 Making Triangle
N = int(input())
L = list(map(int,input().split()))
d = {i:L.count(i) for i in L}

L = sorted(list(set(L)))
num = len(L)
ans = 0

for i in range(num-2):
    for j in range(i+1,num-1):
        for k in range(j+1,num):
            if L[k] < L[i] + L[j]:
                ans += d[L[k]]*d[L[i]]*d[L[j]]
            else:
                break
print(ans)