n = int(input())
if n < 3:
    print(0)
    exit()
L = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                m = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]
                if m < s-m:
                    ans += 1
print(ans) n = int(input()) n int(input()) int input() input if n < 3:
    print(0)
    exit() n < 3 n 3 print(0) print 0 exit() exit 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 i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                m = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]
                if m < s-m:
                    ans += 1 i range(n) range n for j in range(i,n):
        for k in range(j,n):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                m = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]
                if m < s-m:
                    ans += 1 j range(i,n) range i n for k in range(j,n):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                m = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]
                if m < s-m:
                    ans += 1 k range(j,n) range j n if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                m = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]
                if m < s-m:
                    ans += 1 L[i] != L[j] and L[i] != L[k] and L[j] != L[k] L[i] != L[j] and L[i] != L[k] L[i] != L[j] L[i] L i L[j] L j L[i] != L[k] L[i] L i L[k] L k L[j] != L[k] L[j] L j L[k] L k m = max(L[i],L[j],L[k]) m max(L[i],L[j],L[k]) max L[i] L i L[j] L j L[k] L k s = L[i]+L[j]+L[k] s L[i]+L[j]+L[k] L[i]+L[j] L[i] L i L[j] L j L[k] L k if m < s-m:
                    ans += 1 m < s-m m s-m s m ans += 1 ans 1 print(ans) print ans ans = 0 0 ans n = int(input()) int(input()) n ans += 1 1 ans s = L[i]+L[j]+L[k] L[i]+L[j]+L[k] s L = list(map(int,input().split())) list(map(int,input().split())) L m = max(L[i],L[j],L[k]) max(L[i],L[j],L[k]) m
n = int(input())
if n < 3:
    print(0)
    exit()
L = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
                m = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]
                if m < s-m:
                    ans += 1
print(ans)