local function reada(n,m)m=m or 1 r={}for i=1,m do r[i]={}end for i=1,n do for j=1,m do r[j][i]=io.read"*n"end end return unpack(r)end 
local function istri(a,b,c)
if(a==b or b==c or c==a)then return false end
local max=math.max(a,b,c)
if(max==a)then return a<b+c end
if(max==b)then return b<a+c end
return c<a+b
end
N=io.read"*n"
L=reada(N)
c=0
for i=1,N do
for j=i+1,N do
for k=j+1,N do
if(istri(L[i],L[j],L[k]))then c=c+1 end
end end end
print(c)