read n
n=$((n-1))
a=(`tr ' ' '\n' | sort -n`)
c=0
for i in `seq 0 $n`
do
    for j in `seq $((i+1)) $n`
    do
        for k in `seq $((j+1)) $n`
        do
            if((a[i]+a[j]>a[k]))
            then
                if((a[i]!=a[j]&&a[j]!=a[k]))
                then
                    c=$((c+1))
                fi
            else
                break
            fi
        done
    done
done
echo $c