
private fun getInts(): LongArray {
    return readLine()!!.split(" ").map {it.toLong()}.toLongArray()
}


fun main(){
    getInts()
    val v =getInts()
    var count = 0
    for (i in v.indices){
        for (j in i+1 until v.size) {
            for (k in j+1 until v.size) {
                if (noteq3(v[i],v[j],v[k]) && isTriangle(v[i],v[j],v[k])){
                    count++
                }
            }
        }
    }
    print(count)
}

private fun noteq3(i:Long,j:Long,k:Long):Boolean {
    return (i != j) && (j != k) && (k != i)
}
private fun isTriangle(a:Long,b:Long,c:Long):Boolean {
    return (a+b>c)&&(b+c>a)&&(c+a>b)
}