#include <cstdio>
#include <algorithm>
int n,l[103],ans;
int main(){
    scanf("%d",&n);for(int i=1;i<=n;i++) scanf("%d",&l[i]);std::sort(l+1,l+1+n);
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            for(int k=j+1;k<=n;k++){
                if(l[i]+l[j]>l[k]&&l[j]-l[i]<l[k]&&l[i]!=l[j]&&l[j]!=l[k]&&l[i]!=l[k]) ++ans;
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}