"use strict";

function main(input) {
  input = input.trim().split("\n");
  let ans = [];
  let line_two = input[1].split(" ");
  line_two = Array.from(line_two, (x) => parseInt(x)).sort();
  for (let i = 0; i < line_two.length; i++) {
    for (let j = 0; i < line_two.length; i++) {
      for (let n = 0; n < line_two.length; n++) {
        if (triangle(line_two[i], line_two[j], line_two[n])) {
          ans.push([i + 1, j + 1, n + 1]);
        }
      }
    }
  }
  console.log(ans.length);
}

function triangle(a, b, c) {
  if (a == b || b == c || c == a) return false;
  if (a + b > c) {
    return true;
  } else {
    return false;
  }
}

function numberSort(array) {
  array.sort(f);
  return array;
}

var f = function (a, b) {
  return a - b;
};

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
