import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val L = readLine().split(" ").map(_.toInt)

  def solve() = {
    (0 until n).combinations(3).foldLeft(0) { (acc, combi) =>
      val (a,b,c) = (L(combi(0)), L(combi(1)), L(combi(2)))
      val max = Math.max(Math.max(a,b), c)
      val isTriangle = max < a+b+c - max
      val isUnique = a != b && b != c && c != a
      if(isTriangle && isUnique) acc+1 else acc
    }
  }

  println(solve())

}

