def check(a,b,c):
	if a==b or a==c or b==c:
		return False
	if a+b>c and b+c>a and c+a>b:
		
		return True
	return False

n=int(input())
c=list(map(int,input().split()))
count=0
for i in range(len(c)-2):
	for j in range(i+1,len(c)-1):
		for k in range(j+1,len(c)):
			if check(c[i],c[j],c[k]):
				count+=1
print(count)

				


			 def check(a,b,c):
	if a==b or a==c or b==c:
		return False
	if a+b>c and b+c>a and c+a>b:
		
		return True
	return False check if a==b or a==c or b==c:
		return False
	 a==b or a==c or b==c a==b or a==c a==b a b a==c a c b==c b c return False False if a+b>c and b+c>a and c+a>b:
		
		return True
	 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 return True True return False False a a b b c c n=int(input()) n int(input()) int input() input c=list(map(int,input().split())) c 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(len(c)-2):
	for j in range(i+1,len(c)-1):
		for k in range(j+1,len(c)):
			if check(c[i],c[j],c[k]):
				count+=1 i range(len(c)-2) range len(c)-2 len(c) len c 2 for j in range(i+1,len(c)-1):
		for k in range(j+1,len(c)):
			if check(c[i],c[j],c[k]):
				count+=1 j range(i+1,len(c)-1) range i+1 i 1 len(c)-1 len(c) len c 1 for k in range(j+1,len(c)):
			if check(c[i],c[j],c[k]):
				count+=1 k range(j+1,len(c)) range j+1 j 1 len(c) len c if check(c[i],c[j],c[k]):
				count+=1 check(c[i],c[j],c[k]) check c[i] c i c[j] c j c[k] c k count+=1 count 1 print(count) print count n=int(input()) int(input()) n count=0 0 count c=list(map(int,input().split())) list(map(int,input().split())) c count+=1 1 count def check(a,b,c):
	if a==b or a==c or b==c:
		return False
	if a+b>c and b+c>a and c+a>b:
		
		return True
	return False def check(a,b,c):
	if a==b or a==c or b==c:
		return False
	if a+b>c and b+c>a and c+a>b:
		
		return True
	return False check
def check(a,b,c):
	if a==b or a==c or b==c:
		return False
	if a+b>c and b+c>a and c+a>b:
		
		return True
	return False

n=int(input())
c=list(map(int,input().split()))
count=0
for i in range(len(c)-2):
	for j in range(i+1,len(c)-1):
		for k in range(j+1,len(c)):
			if check(c[i],c[j],c[k]):
				count+=1
print(count)

				


			
