N = int(input().rstrip())
l = list(map(int, input().rstrip().split()))
#l = list(set(l))
l.sort(reverse=True)
num = 0
for i in range(len(l) - 2):
	for j in range(i + 1, len(l) - 1):
		if l[i] == l[j]:
			continue

		for k in range(j + 1, len(l)):
			if l[j] == l[k]:
				continue

			if l[i] < (l[j] + l[k]):
				num += 1

print(num) N = int(input().rstrip()) N int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip l = list(map(int, input().rstrip().split())) l list(map(int, input().rstrip().split())) list map(int, input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split l.sort(reverse=True) l.sort l sort reverse=True reverse True num = 0 num 0 for i in range(len(l) - 2):
	for j in range(i + 1, len(l) - 1):
		if l[i] == l[j]:
			continue

		for k in range(j + 1, len(l)):
			if l[j] == l[k]:
				continue

			if l[i] < (l[j] + l[k]):
				num += 1 i range(len(l) - 2) range len(l) - 2 len(l) len l 2 for j in range(i + 1, len(l) - 1):
		if l[i] == l[j]:
			continue

		for k in range(j + 1, len(l)):
			if l[j] == l[k]:
				continue

			if l[i] < (l[j] + l[k]):
				num += 1 j range(i + 1, len(l) - 1) range i + 1 i 1 len(l) - 1 len(l) len l 1 if l[i] == l[j]:
			continue

		 l[i] == l[j] l[i] l i l[j] l j continue for k in range(j + 1, len(l)):
			if l[j] == l[k]:
				continue

			if l[i] < (l[j] + l[k]):
				num += 1 k range(j + 1, len(l)) range j + 1 j 1 len(l) len l if l[j] == l[k]:
				continue

			 l[j] == l[k] l[j] l j l[k] l k continue if l[i] < (l[j] + l[k]):
				num += 1 l[i] < (l[j] + l[k]) l[i] l i l[j] + l[k] l[j] l j l[k] l k num += 1 num 1 print(num) print num num += 1 1 num N = int(input().rstrip()) int(input().rstrip()) N l = list(map(int, input().rstrip().split())) list(map(int, input().rstrip().split())) l num = 0 0 num
N = int(input().rstrip())
l = list(map(int, input().rstrip().split()))
#l = list(set(l))
l.sort(reverse=True)
num = 0
for i in range(len(l) - 2):
	for j in range(i + 1, len(l) - 1):
		if l[i] == l[j]:
			continue

		for k in range(j + 1, len(l)):
			if l[j] == l[k]:
				continue

			if l[i] < (l[j] + l[k]):
				num += 1

print(num)
