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

print(cnt)