
import scala.io.StdIn

object Main extends App {
  StdIn.readLine()
  val sticks = StdIn.readLine().split(' ').map(_.toInt)

  val stickIdCombinations=scala.collection.mutable.Set.empty[Set[Int]]
  for(s1 <- 0 until sticks.length){
    for(s2 <- 0 until sticks.length){
      for(s3 <- 0 until sticks.length){
        val stickLens = List(s1,s2,s3).map(sticks(_)).toSet
        if(stickLens.size == 3){
          stickIdCombinations += Set(s1,s2,s3)
        }
      }
    }
  }

  val ans = (for (stickIds <- stickIdCombinations.toList) yield {
    val List(s1, s2, s3) = stickIds.toList.map(sticks(_))
    if (s1 + s2 > s3 && s2 + s3 > s1 && s3 + s1 > s2)
      1
    else
      0
  }).sum

  println(ans)



}






