import itertools
n = int(input())
l = list(map(int, input().split( )))
pettern = 0
for v in itertools.combinations(l, 3):
    if v[0] != v[1] and v[1] != v[2] and v[2] != v[0]:
        if v[0]+v[1] > v[2] and v[1]+v[2] > v[0] and v[2]+v[0] > v[1]:
            pettern += 1
print(pettern) 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 pettern = 0 pettern 0 for v in itertools.combinations(l, 3):
    if v[0] != v[1] and v[1] != v[2] and v[2] != v[0]:
        if v[0]+v[1] > v[2] and v[1]+v[2] > v[0] and v[2]+v[0] > v[1]:
            pettern += 1 v itertools.combinations(l, 3) itertools.combinations itertools combinations l 3 if v[0] != v[1] and v[1] != v[2] and v[2] != v[0]:
        if v[0]+v[1] > v[2] and v[1]+v[2] > v[0] and v[2]+v[0] > v[1]:
            pettern += 1 v[0] != v[1] and v[1] != v[2] and v[2] != v[0] v[0] != v[1] and v[1] != v[2] v[0] != v[1] v[0] v 0 v[1] v 1 v[1] != v[2] v[1] v 1 v[2] v 2 v[2] != v[0] v[2] v 2 v[0] v 0 if v[0]+v[1] > v[2] and v[1]+v[2] > v[0] and v[2]+v[0] > v[1]:
            pettern += 1 v[0]+v[1] > v[2] and v[1]+v[2] > v[0] and v[2]+v[0] > v[1] v[0]+v[1] > v[2] and v[1]+v[2] > v[0] v[0]+v[1] > v[2] v[0]+v[1] v[0] v 0 v[1] v 1 v[2] v 2 v[1]+v[2] > v[0] v[1]+v[2] v[1] v 1 v[2] v 2 v[0] v 0 v[2]+v[0] > v[1] v[2]+v[0] v[2] v 2 v[0] v 0 v[1] v 1 pettern += 1 pettern 1 print(pettern) print pettern l = list(map(int, input().split( ))) list(map(int, input().split( ))) l n = int(input()) int(input()) n pettern += 1 1 pettern pettern = 0 0 pettern
import itertools
n = int(input())
l = list(map(int, input().split( )))
pettern = 0
for v in itertools.combinations(l, 3):
    if v[0] != v[1] and v[1] != v[2] and v[2] != v[0]:
        if v[0]+v[1] > v[2] and v[1]+v[2] > v[0] and v[2]+v[0] > v[1]:
            pettern += 1
print(pettern)
