import sys; input = sys.stdin.readline
n = int(input())
lis = list(map(int, input().split()))
ans = 0
for i in range(n):
	for j in range(i+1, n):
		for k in range(j+1, n):
			if lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k]: continue
			s = sorted([lis[i], lis[j], lis[k]])
			if s[2] < s[1] + s[0]: ans += 1
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n = int(input()) n int(input()) int input() input lis = list(map(int, input().split())) lis list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in range(n):
	for j in range(i+1, n):
		for k in range(j+1, n):
			if lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k]: continue
			s = sorted([lis[i], lis[j], lis[k]])
			if s[2] < s[1] + s[0]: ans += 1 i range(n) range n for j in range(i+1, n):
		for k in range(j+1, n):
			if lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k]: continue
			s = sorted([lis[i], lis[j], lis[k]])
			if s[2] < s[1] + s[0]: ans += 1 j range(i+1, n) range i+1 i 1 n for k in range(j+1, n):
			if lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k]: continue
			s = sorted([lis[i], lis[j], lis[k]])
			if s[2] < s[1] + s[0]: ans += 1 k range(j+1, n) range j+1 j 1 n if lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k]: continue
			 lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k] lis[i] == lis[j] or lis[j] == lis[k] lis[i] == lis[j] lis[i] lis i lis[j] lis j lis[j] == lis[k] lis[j] lis j lis[k] lis k lis[i] == lis[k] lis[i] lis i lis[k] lis k s = sorted([lis[i], lis[j], lis[k]]) s sorted([lis[i], lis[j], lis[k]]) sorted [lis[i], lis[j], lis[k]] lis[i] lis i lis[j] lis j lis[k] lis k if s[2] < s[1] + s[0]: ans + s[2] < s[1] + s[0] s[2] s 2 s[1] + s[0] s[1] s 1 s[0] s 0 print(ans) print ans input = sys.stdin.readline sys.stdin.readline input n = int(input()) int(input()) n lis = list(map(int, input().split())) list(map(int, input().split())) lis ans = 0 0 ans s = sorted([lis[i], lis[j], lis[k]]) sorted([lis[i], lis[j], lis[k]]) s
import sys; input = sys.stdin.readline
n = int(input())
lis = list(map(int, input().split()))
ans = 0
for i in range(n):
	for j in range(i+1, n):
		for k in range(j+1, n):
			if lis[i] == lis[j] or lis[j] == lis[k] or lis[i] == lis[k]: continue
			s = sorted([lis[i], lis[j], lis[k]])
			if s[2] < s[1] + s[0]: ans += 1
print(ans)