CodeEff/ECCO huggingface dataset:
# Original solution
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import combinations
def main():
    n, *l = list(map(int, read().split()))
    if n < 3:
        print((0))
        sys.exit()
    com = tuple(combinations(l, 3))
    r = 0
    for c in com:
        c1 = c[0]
        c2 = c[1]
        c3 = c[2]
        if c1 == c2 or c2 == c3 or c1 == c3:
            continue
        else:
            cs = sum(c) - max(c)
            r += cs > max(c)

    print(r)
if __name__ == '__main__':
    main()

# Optimized solution
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import combinations
def main():
    n, *a = list(map(int, read().split()))
    coma = combinations(a, 3)
    r = 0
    for c in coma:
        if sum(c) > max(c)*2:
            if len(set(c)) > 2:
                r += 1
    print(r)

if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
L = list(map(int, input().split()))

L = sorted(L)
res = []
cnt = 0
for i in range(len(L)):
  Li = L[i]
  for j in range(len(L)):
    Lj = L[j]
    for k in range(len(L)):
      Lk = L[k]
      if Li + Lj > Lk and Lj + Lk > Li and Lk + Li > Lj:
        if Li != Lj and  Lj!= Lk and Lk != Li:
          if sorted([i, j, k]) not in res:
            res.append(sorted([i, j, k]))
            cnt += 1
print(cnt)

      

# Optimized solution
import itertools

N = int(eval(input()))
L = list(map(int, input().split()))
L = sorted(L)
ref = list(itertools.combinations(L, 3))
cnt = 0
for i in ref:
  Li = i[0]
  Lj = i[1]
  Lk = i[2]
  if Li + Lj > Lk and Lj + Lk > Li and Lk + Li > Lj:
    if Li != Lj and  Lj!= Lk and Lk != Li:
      cnt += 1

print(cnt)
# Original solution
N = int(eval(input()))
L = list(map(int, input().split()))
cnt = 0

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:
                if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
                    cnt += 1
print(cnt)

# Optimized solution
n=int(eval(input()))
l = list(map(int, input().split()))

cnt = 0

# ３つの相異なる数字（i, j, k）の組み合わせを調べること
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            a = l[i]
            b = l[j]
            c = l[k]
            if a == b or b == c or c == a:
                continue
            else:
                if a<b+c and b<c+a and c<a+b:
                    cnt+=1
print(cnt)
# Original solution
N = int(eval(input()))
L = list(map(int, input().split()))
cnt = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if sorted(L)[::-1][i] < sorted(L)[::-1][j] + sorted(L)[::-1][k]:
                if sorted(L)[::-1][i] != sorted(L)[::-1][j] != sorted(L)[::-1][k]:
                    cnt += 1
print(cnt)

# Optimized solution
N = int(eval(input()))
L = sorted(list(map(int, input().split())))[::-1]
cnt = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[i] < L[j] + L[k]:
                if L[i] != L[j] != L[k]:
                    cnt += 1
print(cnt)
# Original solution
n,*l=list(map(int,open(0).read().split()))
print((sum(i!=j!=k!=i and j+k>i and k+i>j and i+j>k for i in l for j in l for k in l)//6))

# Optimized solution
n,*l=list(map(int,open(0).read().split()))
l.sort()
print((sum(i<j<k and i+j>k for i in l for j in l for k in l)))
# Original solution
N = int(eval(input()))
L = [int(x) for x in input().split()]
cnt = 0

for i in range(len(L) - 2):
    for j in range(i+1, len(L)-1):
        for k in range(j+1, len(L)):
            a = L[i]
            b = L[j]
            c = L[k]
            p = a + b > c
            q = b + c > a
            r = c + a > b
            s = a != b
            t = b != c
            u = c != a
            if p and q and r and s and t and u:
                cnt += 1
print(cnt)

# Optimized solution
N = int(eval(input()))
L = [int(x) for x in input().split()]
L.sort()
cnt = 0

for i in range(len(L) - 2):
    for j in range(i+1, len(L)-1):
        for k in range(j+1, len(L)):
            a = L[i]
            b = L[j]
            c = L[k]
            p = a + b > c
            s = a != b
            t = b != c
            if p and s and t:
                cnt += 1
print(cnt)
# Original solution
import sys

def main():
    import itertools
    input = sys.stdin.readline
    n = int(eval(input()))
    l = list(map(int, input().split()))
    ans = 0
    for i in itertools.combinations(l, 3):
        if len(set(i)) == 3 and abs(i[0] - i[1]) < i[2] < i[0] + i[1]:
            ans += 1
    print(ans)




if __name__ == '__main__':
    main()

# Optimized solution
#!/usr/bin/env python3
import sys

def main():
    import itertools
    input = sys.stdin.readline
    _ = int(eval(input()))
    l = list(map(int, input().split()))
    ans = 0
    for i in itertools.combinations(l, 3):
        if len(set(i)) == 3 and abs(i[0] - i[1]) < i[2] < i[0] + i[1]:
            ans += 1
    print(ans)




if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
l = list(map(int, input().split()))

ans = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    for k in range(j+1, n):
      if l[i] != l[j] and l[i] != l[k] and l[j] != l[k]:
        if l[i]+l[j] > l[k] and l[i]+l[k] > l[j] and l[j]+l[k] > l[i]: ans += 1
print(ans)

# Optimized solution
from itertools import combinations
n = int(eval(input()))
l = list(map(int, input().split()))

ans = 0
for i,j,k in combinations(l,3):
  if i == j or i == k or j == k: continue
  if i >= j+k or j >= i+k or k >= i+j: continue
  ans += 1
print(ans)
# Original solution
n = int(eval(input()))
l = list(map(int,input().split()))

nums = set([])
for i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
                continue
            else:
                ver = [l[i],l[j],l[k]]
                num = [i,j,k]
                ver.sort()
                num.sort()
                if ver[0] + ver[1] > ver[2]:
                    nums.add(tuple(num))

print((len(nums)))


# Optimized solution
n = int(eval(input()))
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] or l[i] == l[k] or l[j] == l[k]:
                continue
            else:
                ver = [l[i],l[j],l[k]]
                ver.sort()
                if ver[0] + ver[1] > ver[2]:
                    ans += 1

print(ans)
# Original solution
N=int(eval(input()))
L=list(map(int,input().split()))
L.sort()

ans=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            a,b,c=L[i],L[j],L[k]
            if a!=b and b!=c and a+b>c:
                ans+=1

print(ans)


# Optimized solution
N=int(eval(input()))
L=list(map(int,input().split()))
L.sort()

ans=0
for i in range(N-2):
    a=L[i]
    for j in range(i+1,N-1):
        b=L[j]
        if a==b:
            continue
        for k in range(j+1,N):
            c=L[k]
            if b==c:
                continue
            ans+=a+b>c

print(ans)
# Original solution
n = int(eval(input()))
l = sorted(map(int, input().split()))[::-1]

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[k] < l[j] < l[i] and l[k] + l[j] > l[i]:
                ans += 1
print(ans)


# Optimized solution
n = int(eval(input()))
l = sorted(map(int, input().split()))[::-1]

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[k] < l[j] < l[i] < l[k] + l[j]:
                ans += 1
print(ans)
# Original solution
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    l = list(map(int, readline().split()))

    ans = 0
    for i in range(n):
        a = l[i]
        for j in range(i + 1, n):
            b = l[j]
            if a == b:
                continue
            for k in range(j + 1, n):
                c = l[k]
                if a == c or b == c:
                    continue
                d = [a, b, c]
                d.sort()
                if d[0] + d[1] > d[2]:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k]:
                    ans += 1
print(ans)
# Original solution
import itertools as it


N = int(eval(input())) - 1
s = list(map(int, input().split()))
count = 0

c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    maximum = max(listed)
    listed.remove(maximum)
    if (listed[0] + listed[1]) > maximum:
        count += 1

print(count)

# Optimized solution
import itertools as it


N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    if (listed[0] + listed[1]) > listed[2]:
        count += 1

print(count)
# Original solution
import itertools as it


N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    if (listed[0] + listed[1]) > listed[2]:
        count += 1

print(count)

# Optimized solution
import itertools as it


N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    elif (i[0] + i[1]) > i[2]:
        count += 1

print(count)
# Original solution
N = int(eval(input()))
L = list(map(int, input().split()))
 
ans = 0
if(N >= 3):
  t = []
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if((L[i] != L[j]) & (L[i] != L[k]) & (L[j] != L[k]) & (abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))
  ans = len(t)

print(ans)

# Optimized solution
N = int(eval(input()))
L = list(map(int, input().split()))
 
ans = 0
for i in range(N):
  for j in range(i+1, N):
    for k in range(j+1, N):
      if(L[i] != L[j] and L[i] != L[k] and L[j] != L[k] and abs(L[j]-L[k]) < L[i] and L[i] < L[j]+L[k]):
        ans +=1
          
print(ans)
# Original solution
N=int(eval(input()))
L=list(map(int,input().split(' ')))
l=0
T=[]
for i in range(N):
    for j in range(N):
        for k in range(N):
            if i!=k and i!=j and j!=k:
                u=[i,j,k]
                u.sort()
                if u not in T:
                    T.append(u)
                    if 2*max(L[i],L[j],L[k])<L[i]+L[j]+L[k] and L[i]!=L[k] and L[i]!=L[j] and L[j]!=L[k]:
                        l=l+1
print(l)

# Optimized solution
import itertools
N=int(eval(input()))
L=list(map(int,input().split(' ')))
l=0
T=[]
for u in list(itertools.combinations(L, 3)):
    i,j,k=u
    if 2*max(i,j,k)<i+j+k and i!=k and i!=j and j!=k:
        l=l+1
print(l)
# Original solution
import sys
input = sys.stdin.readline
import itertools as it

def li():
    return [int(x) for x in input().split()]

N = int(eval(input()))
L = li()

# 組み合わせ列挙
c = it.combinations(L, 3)
c_list = list(c)

cnt = 0
for l in c_list:
    unique_l = len(set(l))
    if unique_l != 3:
        continue
    sum_l = l[0] + l[1] + l[2]
    max_l = max(l)
    sum_lest = sum_l - max_l
    if sum_lest > max_l:
        cnt += 1

print(cnt)

# Optimized solution
import sys
input = sys.stdin.readline
import itertools as it

def li():
    return [int(x) for x in input().split()]

N = int(eval(input()))
L = li()

# 組み合わせ列挙
com = it.combinations(L, 3)
com_list = list(com)

cnt = 0
for l in com_list:
    unique_l = len(set(l))
    if unique_l != 3:
        continue
    a, b, c = l[0], l[1], l[2]
    if a < b + c and b < c + a and c < a + b:
        cnt += 1

print(cnt)
# Original solution
import sys
import bisect

def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            if L[i] == L[j]:
                continue
            a = bisect.bisect_right(L[j+1:],L[j])
            b = bisect.bisect_left(L[j+1:],L[i]+L[j])
            count +=b-a


    print(count)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0
    # for i in range(N - 2):
    #     for j in range(i + 1, N - 1):
    #         if L[i] == L[j]:
    #             continue
    #         a = bisect.bisect_right(L[j + 1:], L[j])
    #         b = bisect.bisect_left(L[j + 1:], L[i] + L[j])
    #         count += b - a

    for j in range(1, N-1):
        rem = L[j+1:]
        for i in range(j):
            if L[i] == L[j]:
                break
            a = bisect.bisect_right(rem, L[j])
            b = bisect.bisect_left(rem, L[i] + L[j])
            count += b - a


    print(count)


if __name__ == "__main__":
    main()
# Original solution
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0
    # for i in range(N - 2):
    #     for j in range(i + 1, N - 1):
    #         if L[i] == L[j]:
    #             continue
    #         a = bisect.bisect_right(L[j + 1:], L[j])
    #         b = bisect.bisect_left(L[j + 1:], L[i] + L[j])
    #         count += b - a

    for j in range(1, N-1):
        rem = L[j+1:]
        for i in range(j):
            if L[i] == L[j]:
                break
            a = bisect.bisect_right(rem, L[j])
            b = bisect.bisect_left(rem, L[i] + L[j])
            count += b - a


    print(count)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0

    for j in range(1, N - 1):
        for i in range(j):
            if L[i] == L[j]:
                break
            a = bisect.bisect_right(L[j + 1:], L[j])
            b = bisect.bisect_left(L[j + 1:], L[i] + L[j])
            count += b - a

    print(count)


if __name__ == "__main__":
    main()
# Original solution
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0

    for j in range(1, N - 1):
        for i in range(j):
            if L[i] == L[j]:
                break
            a = bisect.bisect_right(L[j + 1:], L[j])
            b = bisect.bisect_left(L[j + 1:], L[i] + L[j])
            count += b - a

    print(count)


if __name__ == "__main__":
    main()


# Optimized solution
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0
    for j in range(1, N - 1):
        for i in range(j):
            if L[i] == L[j]:
                break
            t = L[i] + L[j]
            for k in range(j + 1, N):
                if L[j] != L[k]:
                    if t > L[k]:
                        count += 1
                    else:
                        break

    print(count)


if __name__ == "__main__":
    main()
# Original solution
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0

    for j in range(1, N - 1):
        for i in range(j):
            if L[i] == L[j]:
                break

            count += bisect.bisect_left(L[j + 1:], L[i] + L[j]) - bisect.bisect_right(L[j + 1:], L[j])

    print(count)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
from bisect import bisect_left, bisect_right


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0

    for j in range(1, N - 1):
        for i in range(j):
            if L[i] == L[j]:
                break

            count += bisect_left(L[j + 1:], L[i] + L[j]) - bisect_right(L[j + 1:], L[j])

    print(count)


if __name__ == "__main__":
    main()
# Original solution
import sys
from bisect import bisect_left, bisect_right


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0

    for j in range(1, N - 1):
        for i in range(j):
            if L[i] == L[j]:
                break

            count += bisect_left(L[j + 1:], L[i] + L[j]) - bisect_right(L[j + 1:], L[j])

    print(count)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
from bisect import bisect_left, bisect_right


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(eval(input()))
    L = list(map(int, input().split()))

    L.sort()
    count = 0

    for j in range(1, N - 1):
        rem = L[j + 1:]
        for i in range(j):
            if L[i] == L[j]:
                break

            count += bisect_left(rem, L[i] + L[j]) - bisect_right(rem, L[j])

    print(count)


if __name__ == "__main__":
    main()
# Original solution
has_duplicates= lambda seq:len(seq) == len(set(seq))
def main():
    n=int(eval(input()))
    l=list(map(int,input().split()))
    tel=[-1,-1,-1]
    temp=0
    bn=0
    tc=0
    pc=0
    i=0
    while len(bin(i))-3<n:
        if str(bin(i)).count('1')==3:
            bn=bin(i)
            tc=0
            tel=[-1,-1,-1]
            for j in range(len(str(bn)[2:])):
                if (i>>j)&1:
                    tel[tc]=l[n-j-1]
                    tc+=1
            if has_duplicates(tel):
                tel.sort()
                if tel[0]+tel[1]>tel[2]:
                    pc+=1
        i+=1
    print(pc)
if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n=int(eval(input()))
    l=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for k in range(i+1,n):
            for j in range(k+1,n):
                temp=[l[i],l[k],l[j]]
                if len(set(temp))==len(temp):
                    temp.sort()
                    if temp[0]+temp[1]>temp[2]:
                        ans+=1
    print(ans)
if __name__ == "__main__":
    main()
# Original solution
import itertools
N=int(eval(input()))
A=list(map(int, input().split()))
ans=0
for any_pair in itertools.combinations(A, 3):
    pair=sorted(any_pair)
    #print(type(pair))
    if pair[0]+pair[1]>pair[2] and pair[1]+pair[2]>pair[0] and pair[0]+pair[2]>pair[1] and pair[0]!=pair[1] and pair[1]!=pair[2]:
        ans+=1
        #print(pair)
print(ans)

# Optimized solution
import itertools
N=int(eval(input()))
A=list(map(int, input().split()))
ans=0
for any_pair in itertools.combinations(A, 3):
    pair=sorted(any_pair)#新しいリストを作成
    #print(type(pair))
    if pair[0]+pair[1]>pair[2] and pair[0]!=pair[1] and pair[1]!=pair[2]:
        ans+=1
        #print(pair)
print(ans)
# Original solution
n = int(eval(input()))
L = [*list(map(int, input().split()))]
M = {}
for l in L:
    if l in M:
        M[l] +=1
    else:
        M[l] = 1
M = list(M.items())
M.sort()
# print(L)
# print(M)
m=len(M)
c=0
for i in range(m):
    for j in range(i+1, m):
        for k in range(j+1, m):
            if M[i][0]+M[j][0] > M[k][0]:
                c += M[i][1] * M[j][1] * M[k][1]
                # print(i,j,k,M[i][0],M[j][0],M[k][0])
                # print(M[i][1],M[j][1],M[k][1])

print(c)


# Optimized solution
n = int(eval(input()))
L = [*list(map(int, input().split()))]
M = {}
for l in L:
    if l in M: M[l] += 1
    else: M[l] = 1
M = list(M.items())
M.sort()
m = len(M)
c = 0
for i in range(m):
    for j in range(i+1, m):
        for k in range(j+1, m):
            if M[i][0]+M[j][0] > M[k][0]:
                c += M[i][1] * M[j][1] * M[k][1]
print(c)
# Original solution
from bisect import bisect_left, bisect_right
n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if l[i] == l[j]:
            continue

        for k in range(j + 1, n):
            if l[i] == l[k] or l[j] == l[k]:
                continue
            if l[i] + l[j] > l[k]:
                ans += 1

print(ans)


# Optimized solution
from bisect import bisect_left, bisect_right
n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()

ans = 0
for j in range(n):
    for k in range(j + 1, n):
        if l[j] == l[k]:
            continue

        ans += max(bisect_left(l, l[j]) - bisect_right(l, l[k] - l[j]), 0)

print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))

ans = 0

for i in range(2**n):
    tmp = []
    for j in range(n):
        if ((i >> j) & 1):
            tmp .append(a[j])
    tmp.sort()
    if len(tmp) == 3 and abs(tmp[0]-tmp[1]) < tmp[2] and tmp[2] < tmp[0]+tmp[1] and tmp[0] != tmp[1] != tmp[2]:
        ans += 1

print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))

ans = 0

for i in range(n):
    for j in range(1,n):
        for k in range(2,n):
            tmp = []
            if i != j != k and i < j < k:
                tmp.append(a[i])
                tmp.append(a[j])
                tmp.append(a[k])
                tmp.sort()
                if len(tmp) == 3 and abs(tmp[0]-tmp[1]) < tmp[2] and tmp[2] < tmp[0]+tmp[1] and tmp[0] != tmp[1] != tmp[2]:
                    ans += 1

print(ans)
# Original solution
n=int(eval(input()))
l=list(map(int,input().split()))
 
ans=0
for i in range(0,n):
    for j in range(i+1,n):
        for k in range(j+1,n):
 
            if l[i]!=l[j] and l[j]!=l[k] and l[i]!=l[k]:
                if  l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[k]+l[i]>l[j]:
                    ans+=1
 
print(ans) 

# Optimized solution
n=int(eval(input()))
L=list(map(int,input().split()))
a=0
for i in range(n-2):
    for j in range(i+1,n-1):
        if L[i]!=L[j]:
            for k in range(j+1,n):
                
                
                if L[i]!=L[k] and L[j]!=L[k] and L[i]<L[j]+L[k] and L[j]<L[i]+L[k] and L[k]<L[j]+L[i]:
                    a+=1
                    
                    

print(a)
# Original solution
from itertools import combinations 

N = int(eval(input()))
L_list = sorted(list(map(int, input().split())))
ans = 0

for x, y, z in combinations(L_list, 3):
  #print(x, y, z)
  if x == y or y == z or z == x:
    continue
  if x + y > z and y + z > x and z + x > y:
    ans += 1

print(ans)

# Optimized solution
from itertools import combinations 

N = int(eval(input()))
L_list = list(map(int, input().split()))
ans = 0

for x, y, z in combinations(L_list, 3):
  #print(x, y, z)
  if x == y or y == z or z == x:
    continue
  if x + y > z and y + z > x and z + x > y:
    ans += 1

print(ans)