# coding: utf-8
n = int(input())
L = list(map(int,input().split()))
l=[]
A=[]
ans=0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a=L[i]
            b=L[j]
            c=L[k]
            if a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b:
                #print(i+1,j+1,k+1)
                #print(a,b,c)
                ans += 1
#print(L)
#print()
print(ans) 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 l=[] l [] A=[] A [] ans=0 ans 0 for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a=L[i]
            b=L[j]
            c=L[k]
            if a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b:
                #print(i+1,j+1,k+1)
                #print(a,b,c)
                ans += 1
#print(L)
#print() i range(n-2) range n-2 n 2 for j in range(i+1, n-1):
        for k in range(j+1, n):
            a=L[i]
            b=L[j]
            c=L[k]
            if a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b:
                #print(i+1,j+1,k+1)
                #print(a,b,c)
                ans += 1
#print(L)
#print() j range(i+1, n-1) range i+1 i 1 n-1 n 1 for k in range(j+1, n):
            a=L[i]
            b=L[j]
            c=L[k]
            if a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b:
                #print(i+1,j+1,k+1)
                #print(a,b,c)
                ans += 1
#print(L)
#print() k range(j+1, n) range j+1 j 1 n a=L[i] a L[i] L i b=L[j] b L[j] L j c=L[k] c L[k] L k if a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b:
                #print(i+1,j+1,k+1)
                #print(a,b,c)
                ans += 1
#print(L)
#print() a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b a!=b and b!=c and c!=a and a+b>c and b+c>a a!=b and b!=c and c!=a and a+b>c a!=b and b!=c and c!=a a!=b and b!=c a!=b a b b!=c b c c!=a 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 ans += 1 ans 1 print(ans) print ans a=L[i] L[i] a ans += 1 1 ans l=[] [] l n = int(input()) int(input()) n ans=0 0 ans c=L[k] L[k] c L = list(map(int,input().split())) list(map(int,input().split())) L A=[] [] A b=L[j] L[j] b
# coding: utf-8
n = int(input())
L = list(map(int,input().split()))
l=[]
A=[]
ans=0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a=L[i]
            b=L[j]
            c=L[k]
            if a!=b and b!=c and c!=a and a+b>c and b+c>a and c+a>b:
                #print(i+1,j+1,k+1)
                #print(a,b,c)
                ans += 1
#print(L)
#print()
print(ans)