function Main(input) {
    var num = parseInt(input.split("\n")[0]);
    var sideLength = input.split("\n")[1].split(" ");
    
    for(var a=0; a<num; a++){
        sideLength[a] = parseInt(sideLength[a]);
    }
    
   var count = 0;
   
   sideLength.sort(
       function(a,b){
           return a-b;
       }
   )
   console.log(num);
   console.log(sideLength);
   
   function deltacheck(a,b,c){
       var aINT = parseInt(a);
       var bINT = parseInt(b);
       var cINT = parseInt(c);
       return (aINT+bINT)>cINT && (aINT+cINT)>bINT && (bINT+cINT)>aINT && aINT!=bINT && aINT!=cINT && bINT!=cINT;
   }
   
   if(num<3){
       console.log(0);
   }else{
       for(var i=0; i<num; i++){
           for(var j=i+1; j<num; j++){
               for(var k=j+1; k<num; k++){
                   if(deltacheck(sideLength[i],sideLength[j],sideLength[k])){
                       count+=1;
                   }
               }
           }
       }
   }
   if(count!=0){
        console.log(count);
   }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));