n=int(input())
M=list(map(int,input().split()))
M.sort()
dic={}
dic[M[0]]=1
for i in range(1,n):
	if(M[i]!=M[i-1]):
		dic[M[i]]=1
	else:
		dic[M[i-1]]+=1

L=list(dic.keys())
l=len(L)
L.sort()
count=0
for i in range(0,l):
	for j in range(0,i):
		for k in range(0,j):
			if(L[i]<L[j]+L[k]):
				count+=dic[L[i]]*dic[L[j]]*dic[L[k]]
print(count) n=int(input()) n int(input()) int input() input M=list(map(int,input().split())) M list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split M.sort() M.sort M sort dic={} dic {} dic[M[0]]=1 dic[M[0]] dic M[0] M 0 1 for i in range(1,n):
	if(M[i]!=M[i-1]):
		dic[M[i]]=1
	else:
		dic[M[i-1]]+=1 i range(1,n) range 1 n if(M[i]!=M[i-1]):
		dic[M[i]]=1
	else:
		dic[M[i-1]]+=1 M[i]!=M[i-1] M[i] M i M[i-1] M i-1 i 1 dic[M[i]]=1 dic[M[i]] dic M[i] M i 1 dic[M[i-1]]+=1 dic[M[i-1]] dic M[i-1] M i-1 i 1 1 L=list(dic.keys()) L list(dic.keys()) list dic.keys() dic.keys dic keys l=len(L) l len(L) len L L.sort() L.sort L sort count=0 count 0 for i in range(0,l):
	for j in range(0,i):
		for k in range(0,j):
			if(L[i]<L[j]+L[k]):
				count+=dic[L[i]]*dic[L[j]]*dic[L[k]] i range(0,l) range 0 l for j in range(0,i):
		for k in range(0,j):
			if(L[i]<L[j]+L[k]):
				count+=dic[L[i]]*dic[L[j]]*dic[L[k]] j range(0,i) range 0 i for k in range(0,j):
			if(L[i]<L[j]+L[k]):
				count+=dic[L[i]]*dic[L[j]]*dic[L[k]] k range(0,j) range 0 j if(L[i]<L[j]+L[k]):
				count+=dic[L[i]]*dic[L[j]]*dic[L[k]] L[i]<L[j]+L[k] L[i] L i L[j]+L[k] L[j] L j L[k] L k count+=dic[L[i]]*dic[L[j]]*dic[L[k]] count dic[L[i]]*dic[L[j]]*dic[L[k]] dic[L[i]]*dic[L[j]] dic[L[i]] dic L[i] L i dic[L[j]] dic L[j] L j dic[L[k]] dic L[k] L k print(count) print count n=int(input()) int(input()) n count=0 0 count count+=dic[L[i]]*dic[L[j]]*dic[L[k]] dic[L[i]]*dic[L[j]]*dic[L[k]] count M=list(map(int,input().split())) list(map(int,input().split())) M l=len(L) len(L) l dic={} {} dic L=list(dic.keys()) list(dic.keys()) L
n=int(input())
M=list(map(int,input().split()))
M.sort()
dic={}
dic[M[0]]=1
for i in range(1,n):
	if(M[i]!=M[i-1]):
		dic[M[i]]=1
	else:
		dic[M[i-1]]+=1

L=list(dic.keys())
l=len(L)
L.sort()
count=0
for i in range(0,l):
	for j in range(0,i):
		for k in range(0,j):
			if(L[i]<L[j]+L[k]):
				count+=dic[L[i]]*dic[L[j]]*dic[L[k]]
print(count)