import itertools
N = int(input())
l = map(int,input().split())

cnt = 0
for a,b,c in itertools.combinations(l,3):
    if abs(a-b) < c < a+b and len(set([a,b,c])) == 3:
        cnt += 1

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

cnt = 0
for a,b,c in itertools.combinations(l,3):
    if abs(a-b) < c < a+b and len(set([a,b,c])) == 3:
        cnt += 1

print(cnt)