n=int(input())
l=list(map(int, input().split()))
#l=list(l)
count=0
for i in range(n-2):
    for j in range(i+1,n-1):
        #print(i)
        if l[j]!=l[i]:
            #print(i)
            for k in range(j+1,n):
                a,b,c=[l[i],l[j],l[k]]
                if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1)
print(count) n=int(input()) n int(input()) int input() input l=list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count=0 count 0 for i in range(n-2):
    for j in range(i+1,n-1):
        #print(i)
        if l[j]!=l[i]:
            #print(i)
            for k in range(j+1,n):
                a,b,c=[l[i],l[j],l[k]]
                if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1) i range(n-2) range n-2 n 2 for j in range(i+1,n-1):
        #print(i)
        if l[j]!=l[i]:
            #print(i)
            for k in range(j+1,n):
                a,b,c=[l[i],l[j],l[k]]
                if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1) j range(i+1,n-1) range i+1 i 1 n-1 n 1 if l[j]!=l[i]:
            #print(i)
            for k in range(j+1,n):
                a,b,c=[l[i],l[j],l[k]]
                if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1) l[j]!=l[i] l[j] l j l[i] l i for k in range(j+1,n):
                a,b,c=[l[i],l[j],l[k]]
                if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1) k range(j+1,n) range j+1 j 1 n a,b,c=[l[i],l[j],l[k]] a [l[i],l[j],l[k]] l[i] l i l[j] l j l[k] l k b c if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1) a!=c and b!=c a!=c a c b!=c b c if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1) a+b>c and b+c>a and c+a>b a+b>c and b+c>a a+b>c a+b a b c b+c>a b+c b c a c+a>b c+a c a b count+=1 count 1 print(count) print count l=list(map(int, input().split())) list(map(int, input().split())) l count+=1 1 count a,b,c=[l[i],l[j],l[k]] [l[i],l[j],l[k]] a b,c=[l[i],l[j],l[k]] [l[i],l[j],l[k]] b c=[l[i],l[j],l[k]] [l[i],l[j],l[k]] c n=int(input()) int(input()) n count=0 0 count
n=int(input())
l=list(map(int, input().split()))
#l=list(l)
count=0
for i in range(n-2):
    for j in range(i+1,n-1):
        #print(i)
        if l[j]!=l[i]:
            #print(i)
            for k in range(j+1,n):
                a,b,c=[l[i],l[j],l[k]]
                if a!=c and b!=c:
                    if a+b>c and b+c>a and c+a>b:
                        count+=1
                    #print(i+1,j+1,k+1)
print(count)