n = int(input())
l = [int(i) for i in input().split()]
l.sort()
count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1,n):
            l1 = l[i]
            l2 = l[j]
            l3 = l[k]
            if (l1 != l2) &(l2 != l3)&(l1 + l2 > l3):
                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 = [int(i) for i in input().split()] l [int(i) for i in input().split()] l.sort() l.sort l 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):
            l1 = l[i]
            l2 = l[j]
            l3 = l[k]
            if (l1 != l2) &(l2 != l3)&(l1 + l2 > l3):
                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):
            l1 = l[i]
            l2 = l[j]
            l3 = l[k]
            if (l1 != l2) &(l2 != l3)&(l1 + l2 > l3):
                count += 1 j range(i+1, n-1) range i+1 i 1 n-1 n 1 for k in range(j+1,n):
            l1 = l[i]
            l2 = l[j]
            l3 = l[k]
            if (l1 != l2) &(l2 != l3)&(l1 + l2 > l3):
                count += 1 k range(j+1,n) range j+1 j 1 n l1 = l[i] l1 l[i] l i l2 = l[j] l2 l[j] l j l3 = l[k] l3 l[k] l k if (l1 != l2) &(l2 != l3)&(l1 + l2 > l3):
                count += 1 (l1 != l2) &(l2 != l3)&(l1 + l2 > l3) (l1 != l2) &(l2 != l3) l1 != l2 l1 l2 l2 != l3 l2 l3 l1 + l2 > l3 l1 + l2 l1 l2 l3 count += 1 count 1 print(count) print count count += 1 1 count l = [int(i) for i in input().split()] [int(i) for i in input().split()] l n = int(input()) int(input()) n l2 = l[j] l[j] l2 l1 = l[i] l[i] l1 count = 0 0 count l3 = l[k] l[k] l3
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
count = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1,n):
            l1 = l[i]
            l2 = l[j]
            l3 = l[k]
            if (l1 != l2) &(l2 != l3)&(l1 + l2 > l3):
                count += 1
print(count)