require 'pp'

n = gets.to_i
l_n = gets.split.map(&:to_i)

cnt = 0
(0..(n-1)).to_a.combination(3) do |x|
    a, b, c = l_n[x[0]], l_n[x[1]], l_n[x[2]]
    if a == b || b == c || c == a
        next
    elsif a + b > c && b + c > a && c + a > b
        #pp x
        cnt += 1
    end
end

    
puts cnt

        