import java.util.*
import kotlin.math.absoluteValue

fun main() {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val ls = (1..n).map { sc.nextInt() }
    val result = calc(n, ls)

    println(result.toString())
}

fun calc(n: Int, ls: List<Int>): Int {
    var cnt = 0
    ls.forEachIndexed { aindex, a ->
        ls.forEachIndexed { bindex, b ->
            ls.forEachIndexed { cindex, c ->
                if((b - c).absoluteValue < a && a < b + c && aindex != bindex && bindex != cindex && aindex != cindex && a < b && b < c) cnt++
            }
        }
    }
    return cnt
}
