from itertools import combinations 

N=input()
L=[int(x) for x in input().split()]
comb = combinations(L, 3)
c = 0
for x in comb:
    t=list(x)
    t.sort()
    if t[0]!=t[1] and t[1]!=t[2] and t[0]!=t[2] and t[0]+t[1]>t[2]:
        c += 1
print(c) from itertools import combinations N=input() N input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x L=[int(x) for x in input().split()] L [int(x) for x in input().split()] comb = combinations(L, 3) comb combinations(L, 3) combinations L 3 c = 0 c 0 for x in comb:
    t=list(x)
    t.sort()
    if t[0]!=t[1] and t[1]!=t[2] and t[0]!=t[2] and t[0]+t[1]>t[2]:
        c += 1 x comb t=list(x) t list(x) list x t.sort() t.sort t sort if t[0]!=t[1] and t[1]!=t[2] and t[0]!=t[2] and t[0]+t[1]>t[2]:
        c += 1 t[0]!=t[1] and t[1]!=t[2] and t[0]!=t[2] and t[0]+t[1]>t[2] t[0]!=t[1] and t[1]!=t[2] and t[0]!=t[2] t[0]!=t[1] and t[1]!=t[2] t[0]!=t[1] t[0] t 0 t[1] t 1 t[1]!=t[2] t[1] t 1 t[2] t 2 t[0]!=t[2] t[0] t 0 t[2] t 2 t[0]+t[1]>t[2] t[0]+t[1] t[0] t 0 t[1] t 1 t[2] t 2 c += 1 c 1 print(c) print c N=input() input() N comb = combinations(L, 3) combinations(L, 3) comb L=[int(x) for x in input().split()] [int(x) for x in input().split()] L c += 1 1 c t=list(x) list(x) t c = 0 0 c
from itertools import combinations 

N=input()
L=[int(x) for x in input().split()]
comb = combinations(L, 3)
c = 0
for x in comb:
    t=list(x)
    t.sort()
    if t[0]!=t[1] and t[1]!=t[2] and t[0]!=t[2] and t[0]+t[1]>t[2]:
        c += 1
print(c)