n = io.read("*n")
local t = {}
for i = 1, n do
  t[i] = io.read("*n")
end
local function comp(a, b, c)
  if a == b or b == c or c == a then return false end
  return a < b + c and b < a + c and c < a + b
end
local r = 0
for i = 1, n - 2 do
  for j = i + 1, n - 1 do
    for k = j + 1, n do
      if comp(t[i], t[j], t[k]) then
        r = r + 1
      end
    end
  end
end
print(r)
