import itertools
n = int(input())
l = list(map(int, input().split()))
ans = 0
for a,b,c in itertools.combinations(l,3):
    if abs(a-b) < c < a+b and len(set([a,b,c])) == 3:
        ans += 1
print(ans) import itertools itertools 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 ans = 0 ans 0 for a,b,c in itertools.combinations(l,3):
    if abs(a-b) < c < a+b and len(set([a,b,c])) == 3:
        ans += 1 a b c itertools.combinations(l,3) itertools.combinations itertools combinations l 3 if abs(a-b) < c < a+b and len(set([a,b,c])) == 3:
        ans += 1 abs(a-b) < c < a+b and len(set([a,b,c])) == 3 abs(a-b) < c < a+b abs(a-b) < c abs(a-b) abs a-b a b c a+b a b len(set([a,b,c])) == 3 len(set([a,b,c])) len set([a,b,c]) set [a,b,c] a b c 3 ans += 1 ans 1 print(ans) print ans ans = 0 0 ans n = int(input()) int(input()) n l = list(map(int, input().split())) list(map(int, input().split())) l ans += 1 1 ans
import itertools
n = int(input())
l = list(map(int, input().split()))
ans = 0
for a,b,c in itertools.combinations(l,3):
    if abs(a-b) < c < a+b and len(set([a,b,c])) == 3:
        ans += 1
print(ans)