open Batteries
let get_max a b c = max a @@ max b c
let get_others a b c =
  let max_ = get_max a b c in
    if a = max_ then (b, c) else
    if b = max_ then (a, c) else (a, b)


let n = read_int ()
let l = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ fun a -> a

let is_triangle a b c =
  let cosa = (float_of_int @@ b * b + c * c - a * a) /. (float_of_int @@ 2 * b * c) in
  -1. < cosa && cosa < 1.


let rec i_loop i result_i =

  let rec j_loop j result_j =

    let rec k_loop k result_k =
      if k >= n then result_k else (
        if l.(i) = l.(j) || l.(j) = l.(k) || l.(i) = l.(k) then k_loop (k+1) result_k else
        if is_triangle l.(i) l.(j) l.(k) then k_loop (k+1) (result_k+1) else k_loop (k+1) result_k
      )
    in if j >= n then result_j else j_loop (j+1) (result_j + k_loop (j+1) 0)
  in if i >= n then result_i else i_loop (i+1) (result_i + j_loop (i+1) 0)

let _ = Printf.printf "%d\n" @@ i_loop 0 0
