read n
read al
a=($al)
cnt=0
for((i=0;i<n;i++));do
	for((j=i+1;j<n;j++));do
		for((k=j+1;k<n;k++));do
			if [ ${a[i]} -ne ${a[j]} -a ${a[j]} -ne ${a[k]} -a ${a[k]} -ne ${a[i]} ];then
				s=$[${a[i]}+${a[j]}+${a[k]}]
				m=${a[i]}
				if [ $m -lt ${a[j]} ];then
					m=${a[j]}
				fi
				if [ $m -lt ${a[k]} ];then
					m=${a[k]}
				fi
				if [ $s -gt $[m*2] ];then
					cnt=$[cnt+1]
				fi
			fi
		done
	done
done
echo $cnt
