n=int(input())
l_list=[int(i) for i in input().split()]
l_list.sort()

count=0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            li=l_list[i]
            lj=l_list[j]
            lk=l_list[k]
            if li!=lj and li!=lk and lj!=lk:
                if lk<li+lj:
                    count+=1
            
print(count) n=int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i l_list=[int(i) for i in input().split()] l_list [int(i) for i in input().split()] l_list.sort() l_list.sort l_list sort count=0 count 0 for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            li=l_list[i]
            lj=l_list[j]
            lk=l_list[k]
            if li!=lj and li!=lk and lj!=lk:
                if lk<li+lj:
                    count+=1
             i range(n-2) range n-2 n 2 for j in range(i+1, n-1):
        for k in range(j+1, n):
            li=l_list[i]
            lj=l_list[j]
            lk=l_list[k]
            if li!=lj and li!=lk and lj!=lk:
                if lk<li+lj:
                    count+=1
             j range(i+1, n-1) range i+1 i 1 n-1 n 1 for k in range(j+1, n):
            li=l_list[i]
            lj=l_list[j]
            lk=l_list[k]
            if li!=lj and li!=lk and lj!=lk:
                if lk<li+lj:
                    count+=1
             k range(j+1, n) range j+1 j 1 n li=l_list[i] li l_list[i] l_list i lj=l_list[j] lj l_list[j] l_list j lk=l_list[k] lk l_list[k] l_list k if li!=lj and li!=lk and lj!=lk:
                if lk<li+lj:
                    count+=1
             li!=lj and li!=lk and lj!=lk li!=lj and li!=lk li!=lj li lj li!=lk li lk lj!=lk lj lk if lk<li+lj:
                    count+=1
             lk<li+lj lk li+lj li lj count+=1 count 1 print(count) print count li=l_list[i] l_list[i] li count=0 0 count lj=l_list[j] l_list[j] lj l_list=[int(i) for i in input().split()] [int(i) for i in input().split()] l_list lk=l_list[k] l_list[k] lk count+=1 1 count n=int(input()) int(input()) n
n=int(input())
l_list=[int(i) for i in input().split()]
l_list.sort()

count=0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            li=l_list[i]
            lj=l_list[j]
            lk=l_list[k]
            if li!=lj and li!=lk and lj!=lk:
                if lk<li+lj:
                    count+=1
            
print(count)
