We have sticks numbered 1, \cdots, N. The length of Stick i (1 \leq i \leq N) is L_i.
In how many ways can we choose three of the sticks with different lengths that can form a triangle?
That is, find the number of triples of integers (i, j, k) (1 \leq i < j < k \leq N) that satisfy both of the following conditions:
 - L_i, L_j, and L_k are all different.
 - There exists a triangle whose sides have lengths L_i, L_j, and L_k.

-----Constraints-----
 - 1 \leq N \leq 100
 - 1 \leq L_i \leq 10^9
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N
L_1 L_2 \cdots L_N

-----Output-----
Print the number of ways to choose three of the sticks with different lengths that can form a triangle.

-----Sample Input-----
5
4 4 9 7 5

-----Sample Output-----
5

The following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).

Difficulty: introductory

Starter code:

Solutions:
n = int(input())
l = list(map(int,input().split()))
cnt = 0
for i in range(0,n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            x = [l[i],l[j],l[k]]
            ma = sorted(x)[2]
            _ma = sorted(x)[0] + sorted(x)[1]
            if l[i] != l[j] and l[i] != l[k] and l[j] != l[k] and ma < _ma:
                cnt += 1
print(cnt)

n = int(input())
l = [int(s) for s in input().split()]
l.sort(key=int)

count = 0
for i in range(len(l)):
    for j in range(i+1,len(l)):
        for t in range(j+1,len(l)):
            if l[i] + l[j] > l[t] and l[i] != l[j] != l[t]:
                count += 1
print(count)

N=int(input())
L = list(map(int, input().split()))

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

print(count)

n = int(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 = l[i]
      b = l[j]
      c = l[k]
      if a != b and b != c and c < a + b:
        ans += 1
print(ans)

n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0

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

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N - 2):
    side1 = L[i]
    for j in range(i + 1, N - 1):
        side2 = L[j]
        if side1 == side2:
            continue
        lim = side1+ side2
        for k in range(j+1,N):
            side3 = L[k]
            if side3 >= lim:
                break
            if side3 != side2:
                ans += 1

print(ans)

N = int(input())
L = list(map(int,input().split()))
p = 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] > L[k] and L[k] + L[i] > L[j] and L[j] + L[k] > L[i] and L[i] != L[j] != L[k] != L[i]:
                p += 1
            else:
                pass

print(p)

n = int(input())
l = list(map(int, input().split()))
ls = sorted(l)

ans = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            a, b, c = ls[i], ls[j], ls[k]
            if len(set([a,b,c])) == 3:
                if a + b > c:
                    ans += 1

print(ans)




N = int(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 len(set([L[i],L[j],L[k]]))== 3 and L[i]+L[j]>L[k] : ans += 1

print(ans)

import itertools

n = int(input())
numbers = list(map(int, input().split()))


def canMakeTriangle(a, b, c):
    return (a < b + c) and (b < a + c) and (c < a + b)


def isDifferentLength(a, b, c):
    return (a != b) and (b != c) and (c != a)


def isTargetTriangle(a, b, c):
    return isDifferentLength(a, b, c) and canMakeTriangle(a, b, c)


total = 0
for (a, b, c) in list(itertools.combinations(numbers, 3)):
    if isTargetTriangle(a, b, c):
        total += 1

print(total)


N = int(input())
L = list(map(int, input().split()))
L.sort()
count = 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] and L[i] + L[j] > L[k]:
                count += 1
print(count)

n = int(input(""))
s = list(map(int,input().split()))
cnt = 0
s.sort()

for i in range(0,n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if s[i] != s[j] != s[k]:
                if s[i] + s[j] > s[k]:
                    cnt += 1

print(cnt)

N = int(input())
L = list(map(int,input().split()))
ans = 0
lines = []
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[j] != L[k] and L[k] != L[i]:
                lines = []
                lines.append(L[i])
                lines.append(L[j])
                lines.append(L[k])
                lines.sort()
                if lines[0]+lines[1] > lines[2]:
                    ans += 1
print(ans)

n = int(input())
L = sorted(list(map(int, input().split())))

# a+b>c かつ b+c>a かつ c+a>b
cnt = 0
for i in range(n - 2):
    a = L[i]
    for j in range(i + 1, n - 1):
        b = L[j]
        if a != b:
            for k in range(j + 1, n):
                c = L[k]
                if a != c and b != c and a + b > c and b + c > a and c + a > b:
                    cnt += 1

print(cnt)


n = int(input())

l = list(map(int, input().split()))

l = sorted(l)

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]) and (l[i] + l[j] > l[k]):
                ans += 1

print(ans)


def isTri(a,b,c):
  if (a+b>c and b+c>a and c+a>b):
    return True
  return False

def isDiffEach(a,b,c):
  if (a!=b and b!=c and c!=a):
    return True
  return False
  
def main():
  n=int(input())
  l=list(map(int,input().split()))
  c=0
  for i in range(n):
    for j in range(i+1,n):
      for k in range(j+1,n):
        if isTri(l[i],l[j],l[k]) and isDiffEach(l[i],l[j],l[k]):
          c+=1
  print(c)

main()

n=int(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] and l[i]!=l[j] and l[j]!=l[k]:
                ans+=1
print(ans)

import itertools
n = int(input())
l = list(map(int, input().split()))
ans = 0

for comb in itertools.combinations(l, 3):
    li = list(comb)
    li.sort()
    if li[2] < li[0]+li[1] and li[0] != li[1] != li[2]:
        ans += 1

print(ans)


N = int(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] + L[k] > max(2 * L[i], 2 * L[j], 2 * L[k])) and (L[i] != L[j]) and (L[j] != L[k]) and (L[k] != L[i]):
                ans += 1
print(ans)

n = int(input())
l = list(map(int, input().split()))

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

N = int(input())
L_l = sorted(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_l[i] < L_l[j] and L_l[j] < L_l[k] and L_l[i] + L_l[j] > L_l[k]:
                ans += 1
            else:
                continue
print(ans)

n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0

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

n = int(input())
l = list(map(int,input().split()))
cnt = 0
for a in range(n-2):
    for b in range(a+1,n-1):
        for c in range(b+1,n):
            if len(set([l[a],l[b],l[c]])) == 3:
                if l[a]+l[b] > l[c] and l[b]+l[c] > l[a] and l[c]+l[a] > l[b]:
                    cnt += 1
print(cnt)

# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return list(map(int, input().split()))


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    N = input_int()
    L = input_to_int_tuple()

    distinct_L = set(L)

    ret = 0
    if len(distinct_L) < 3:
        return ret

    # L = sorted(L)
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                li, lj, lk = L[i], L[j], L[k]
                sorted_val = sorted([li, lj, lk])
                if sorted_val[0] != sorted_val[1] != sorted_val[2] and (sorted_val[0] + sorted_val[1]) > sorted_val[2]:
                    ret += 1

    return ret


def __starting_point():
    print((main()))

__starting_point()


N, = map(int,input().split())
A = list(map(int,input().split()))
c = 0
n = len(A)
if len(A)<3:
  print(0)
  return
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if (2*max(A[i],A[j],A[k])-sum([A[i],A[j],A[k]])>=0) or A[i]==A[j] or A[j]==A[k] or A[k] == A[i]:
        continue
      c+=1
print(c)      

n=int(input())
a = list(map(int,input().split()))
a=sorted(a)
ans=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        for k in range(j+1,len(a)):
            if a[i]+a[j]>a[k] and a[i]!=a[j] and a[j] != a[k]:
                ans+=1
print(ans)

n = int(input())
a = list(map(int, input().split()))
a.sort()

ans = 0
for i in range(n):
	for j in range(i):
		for k in range(j):
			if a[i] < a[k] + a[j] and a[i] != a[j] and a[j] != a[k]:
				ans += 1

print(ans)


# 入力
N = int(input())
L = list(map(int, input().split()))

# 処理
L.sort()
count = 0
for i in range(N):
    for j in range(0,i):
        for k in range(0,j):
            if (L[i] != L[j] != L[k] and
                L[k] + L[j]  > L[i]):
                count += 1

print(count)

N = int(input())
L = list(map(int, input().split()))

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

print(count)

#b
n=int(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):
            if l[i]!=l[j] and l[j]!=l[k] and l[i]!=l[k] and l[i]+l[j]>l[k]:
                ans+=1

print(ans)

N = int(input())
L = list(map(int, input().split()))
L.sort()
count = 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]:
                    count += 1
print(count)

def isTri(a,b,c):
  if (a!=b and b!=c and c!=a) and \
      (a+b>c and b+c>a and c+a>b):
    return True
  else:
    return False

def main():
  n=int(input())
  l=list(map(int,input().split()))
  c=0
  for i in range(n):
    for j in range(i+1,n):
      for k in range(j+1,n):
        if isTri(l[i],l[j],l[k]):
          c+=1
  print(c)

main()

from itertools import combinations

N=int(input())
L=list(map(int,input().split()))

count=0

for a,b,c in combinations(L,3):
  if a+b>c and a+c>b and b+c>a and a!=b and b!=c and a!=c:
    count+=1
print(count)

count = 0
n = int(input())
numbers = list(map(int, input().split()))
numbers.sort()
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if (numbers[i] + numbers[j]) > numbers[k]:
                if numbers[i] != numbers[j] and numbers[j] != numbers[k]:
                    count += 1
print(count)


def cin():
    return list(map(int, input().split()))

N = int(input())
L = cin()
count = 0

for i in range(0, N - 2):
    for j in range(1 + i, N - 1, 1):
        for k in range(1 + j, N, 1):
            data = [L[i], L[j], L[k]]
            data.sort()
            if data[0] == data[1] or data[1] == data[2] or data[2] == data[0]:
                continue
            if data[0] + data[1] > data[2]:
                count += 1
            
print(count)


n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n):
    for j in range(i+1,n):
        if l[i]==l[j]:continue
        for k in range(j+1,n):
            if l[j]==l[k]:continue
            if l[i]+l[j]>l[k]:ans+=1
print(ans)

N = int(input())
nums = [int(i) for i in input().split()]
nums =sorted(nums)
ans = 0
for i in range(N):
    for j in range(i + 1, N):
        for k in range(j + 1, N):
            # 1つ目の条件
            if nums[i] != nums[j] and nums[j] != nums[k]:
                # 2つ目の条件
                if nums[i] + nums[j] > nums[k]:
                    ans += 1
                    
print(ans)

def main():
    n = int(input())
    s = input()
    l = s.split()
    #print(l)
    l = [int(x) for x in l]
    l.sort()
    cnt=0
    #print(l)
    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
                #print("{},{},{}".format(l[i], l[j], l[k]))
                cnt += triangle(l[i], l[j], l[k])
    print(cnt)

def triangle(a, b, c):
    if(a + b > c and b + c > a and c + a > b):
        return 1
    else:
        return 0

def __starting_point():
    main()
__starting_point()

N = int(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] and l[i] != l[j] and l[j] != l[k]:
                ans += 1
print(ans)


N = int(input())
L = list(map(int,input().split()))
L = sorted(L)

cnt = 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] or L[j] == L[k]:
                continue
            if L[i] + L[j] > L[k]:
                cnt += 1

print(cnt)


# Nを受け取る
N = int(input())

# Lを受け取る
L = list(map(int, input().split()))

# 組み合わせを作る
import itertools as it

c = it.combinations(L, 3)

# 3辺の長さが異なる組み合わせを作る & 長辺 < 他2辺の和
count = 0
for i in c:
  #print(i[0], i[1], i[2])
  # カウントする
  if len(set(i)) == 3:
    a,b,c = sorted(i, reverse=True)
    #print(a,b,c)
    if a < b+c:
      count+= 1
# 出力
print(count)

n = int(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)

import itertools
N = int(input())
L = map(int,input().split())
count=0
for i,j,k in list(itertools.combinations(L,3)):
  if (i!=j and j!=k and i!=k) and (i+j>k and i+k>j and j+k>i):count+=1
print(count)

n = int(input())
L = list(map(int, input().split()))
count = 0
for a in range(n-2):
    for b in range(a+1,n-1):
        for c in range(b+1,n):
            if L[a]+L[b]>L[c] and L[b]+L[c]>L[a] and L[c]+L[a]>L[b]:
                if L[a]!=L[b] and L[b]!=L[c] and L[c]!=L[a]:
                    count += 1
print(count)


#n = int(input()) #入力
#a, b = (int(x) for x in input().split())
#a, b = map(int, input().split())

#G = [input() for i in range(0, H)] #文字列を複数行に渡って

#a = [int(x) for x in input().split()]
#a = list(map(int, input().split()))
#a = [list(map(int,input().split(" "))) for i in range(N)]   #2次元


#a.sort() # C++ の sort(a.begin(), a.end());
#a.append(3) # C++ の a.push_back(3);


#return # return 0 的な。終了できる。
## 整数の切り捨て除算は // (ダブルスラッシュ)


#a[始まりの位置: 終わりの位置: スライスの増分] # (a は配列)


#import numpy as np  #importに100 ms 程度かかる。
import math
import copy
import string
#math.gcd(a, b) で、gcd 計算できる。
#math.pi は円周率。

INF = int(10**18) #べき乗 C++ の pow(10, 18) or 1e18;
pi = math.pi

MOD = 1000000007
#MOD = 1000000009
#MOD = 998244353




#繰り返し2乗法
#N^aの、Mで割った余りを求める。
def my_pow(N, a, M):
    if(a == 0):
        return 1
    else:
        if(a % 2 == 0):
            tempo = my_pow(N, a/2, M)
            return (tempo * tempo) % M
        else:
            tempo = my_pow(N, a - 1, M)
            return (tempo * N) % M




#N_C_a を M で割った余り
def my_combination(N, a, M):
    res = 1

    for i in range(0, a):
        res *= N - i
        res %= M

    for i in range(0, a):
        res *= my_pow(i + 1, M - 2, M)
        res %= M

    return res




#N_C_i を M で割った余りを、v[i] に代入する。
def my_combination_table(N, M, v):
    if(len(v) < N + 1):
        l = N + 1 - len(v)
        tempo = [1] * l
        v.extend(tempo)

    for i in range(1, N + 1):
        v[i] = v[i - 1] * (N - (i - 1))
        v[i] %= M

        v[i] *= my_pow(i, M - 2, M)
        v[i] %= M

    return




#math.factorial で階乗は計算できる。
#math.gcd で gcd は計算できる。
#np.gcd.reduce(A) #(Aは配列) で、Aの全ての要素の gcd が計算できる。


N = int(input())
L =[int(x) for x in input().split()]

res = 0
for i in range(0, N):
    for j in range(i + 1, N):
        for k in range(j + 1, N):
            #print(L[i], L[j], L[k])
            tempo = [L[i], L[j], L[k]]
            tempo.sort()
            
            #print(tempo[0], tempo[1], tempo[2])
            if(tempo[0] + tempo[1] > tempo[2] and tempo[0] < tempo[1] and tempo[1] < tempo[2]): 
                res += 1
                #print(i, j, k)
print(res)

















n = int(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)


import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N = ri()
L = ri_()

def f(L):
    L_ = sorted(L)
    return len(set(L_)) == 3 and L_[0] + L_[1] > L_[2]

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        for k in range(j + 1, N):
            if f([L[i], L[j], L[k]]):
                ans += 1
print(ans)

N = int(input())
L_l = sorted(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_l[i] < L_l[j] and L_l[j] < L_l[k] and L_l[i] + L_l[j] > L_l[k]:
                ans += 1

print(ans)

n=int(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):
            a=L[i]
            b=L[j]
            c=L[k]
            A=[a,b,c]
            if a==b or b==c or c==a:
                continue
            if sum(A)-2*max(A)>0:
                ans+=1
print(ans)

# 棒の長さをリストに取得する
n = int(input())
l_list = list(map(int,input().split()))

l_sorted = sorted(l_list, reverse=True)

# 三角形の成立条件を満たす3辺の組み合わせをカウントする
combination_count = 0
for i in range(n -2):
  l1 = l_sorted[i]
  for j in range(i + 1 , n -1):
    l2 = l_sorted[j]
    for k in range(j + 1 , n):
      l3 = l_sorted[k]

      if len(set([l1, l2, l3])) == 3:
        if l1 < l2 + l3:
          combination_count += 1
        else:
          break

print(combination_count)

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

    if N < 3:
        print((0))
        return

    ans = 0
    for i in range(N-2):
        for j in range(i+1, N-1):
            for k in range(j+1, N):
                Li = L[i]
                Lj = L[j]
                Lk = L[k]
                if Li != Lj and Lj != Lk and Lk != Li and Li < Lj + Lk and Lj < Li + Lk and Lk < Li + Lj:
                    ans += 1

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

n = int(input())

l_n = list(map(int, input().split()))
l_n.sort()

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_n[i] != l_n[j] != l_n[k] and l_n[i] + l_n[j] > l_n[k]:
                ans += 1

print(ans)


n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
count = 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[j] != l[k] and l[i] + l[j] > l[k]:
                count += 1
print(count)

import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

n = int(input())
L = [int(i) for i in input().split()]

tmp = 0
res = 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] and abs(L[i] - L[j]) < L[k] < L[i] + L[j]:
                res += 1

print(res)


n = int(input())
array = sorted(map(int, input().split()))
count = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
 #           if array[i] != array[j] and array[j] != array[k] and array[k] != array[i]:
                if array[i] < array[j] and array[j] < array[k] and array[i]+array[j] > array[k]:
                    count+=1

print(count)

N = int(input())
L = list(map(int,input().split()))
count = 0
for i in range(N):
    for j in range(N):
        for k in range(N):
            if not (i < j < k):
                continue
            if len(set([L[i],L[j],L[k]])) < 3:
                continue
            if L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] > L[i]:
                count += 1
print(count)

n = int(input())
l_list = list(map(int, input().split()))

len_l = len(l_list)
l_list = sorted(l_list)
cnt = 0
for i in range(len_l-2):
    for j in range(i+1, len_l-1):
        for k in range(j+1, n):
            a = l_list[i]
            b = l_list[j]
            c = l_list[k]
            if a != b != c and a + b > c:
                cnt += 1
print(cnt)


N = int(input())
L = sorted(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[j] < L[k] and L[k] <L[i] + L[j]:
          ans += 1

print(ans)

n = int(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)

import sys

N = int(input())
L = list(map(int, input().split()))
count = 0
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 abs(b-c) < a < b+c and (a != b and a != c and b != c):
                count += 1
print(count)


n = int(input())
l = list(map(int,input().split()))
l.sort()

ans = 0



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


def main():
    
    N = int(input())
    a = list(map(int, input().split()))
    a.sort()
    cnt = 0
    
    for i in range(N-2):
        
        for j in range(i+1, N-1):
            if a[i] == a[j]:
                continue
            
            for k in range(j+1, N):
                if a[i] == a[k] or a[j] == a[k]:
                    continue
                if a[k] < (a[i] + a[j]):
                    cnt += 1
    
    
    print(cnt)
    
def __starting_point():
    main()
__starting_point()

n,*l=map(int,open(0).read().split())
ans=0
l.sort()
for i in range(n):
  for j in range(i):
    for k in range(j):
      if l[k]==l[j] or l[j]==l[i]:
        continue
      if l[k]+l[j]>l[i]:
        ans+=1
print(ans)

import itertools

def b175(n, llist):

    ans = 0

    itelist = list(itertools.combinations(range(len(llist)), 3))

    for a, b, c in itelist:
        if (llist[a]+llist[b] > llist[c]
                and llist[b]+llist[c] > llist[a]
                and llist[c]+llist[a] > llist[b]
                and llist[a] != llist[b] and llist[b] != llist[c] and llist[c] != llist[a]):
           ans += 1

    return ans

def main():
    n = int(input())
    llist = list(map(int, input().split()))
    print(b175(n, llist))

def __starting_point():
    main()
__starting_point()

from itertools import combinations
from typing import List


def answer(n: int, l: List[int]) -> int:
    count = 0
    l.sort()
    for i, j, k in combinations(l, 3):
        if i != j != k and k < i + j:
            count += 1

    return count


def main():
    n = int(input())
    l = list(map(int, input().split()))
    print((answer(n, l)))


def __starting_point():
    main()

__starting_point()

def main():
	N = int(input())
	L = [int(l) for l in input().split(" ")]
	cnt = 0
	L.sort()
	for i in range(len(L)):
		for j in range(i + 1, len(L)):
			for k in range(j + 1, len(L)):
				if L[k] < L[i] + L[j] and L[i] != L[j] and L[j] != L[k]:
					cnt += 1
	print(cnt)

main()

import itertools

N = int(input())
L = list(map(int,input().split()))
count = 0
pair_list = []
for pair in itertools.combinations(L, 3):
    a = sorted(list(pair))
    if (a[0] != a[1] and a[0] != a[2] and a[1] != a[2]) and abs(a[0] - a[1]) < a[2] and a[2] < a[0] + a[1]:
        count = count + 1
        pair_list.append(a)
print(count)

# Nを取得する
N = int(input())

# リストのLを取得する
L = list(map(int, input().split()))

# Lの三つの組み合わせ全部に対して条件を検証する
counter=0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            # Li, Lj, Lkの全ての値が異なり、三角形の条件を満たすならcounter+1
            if len(set([L[i], L[j], L[k]])) == 3 and L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j]:
                counter += 1
                
print(counter)

import itertools
import collections

N = int(input())
Ls = list(map(int, input().split()))

L_combination = itertools.combinations(Ls, 3)

ans = 0
for sanpenList in L_combination:
    checker = set(sanpenList)
    if(len(sanpenList) != len(checker)):
        continue

    if(max(sanpenList) * 2 >= sum(sanpenList)):
        continue

    ans += 1

print(ans)

from itertools import combinations
n = int(input())
l = list(map(int, input().split()))
idx = [i for i in range(n)]
idx = combinations(idx, 3)
ans = 0
l.sort()
for i, j, k in idx:
    if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i] and l[i]+l[j] > l[k]:
        ans += 1
print(ans)

n = int(input())
l = list(map(int,input().split()))
l.sort()
count = 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] and l[i]+l[j]>l[k]):
        count+=1
print(count)

import sys
readline = sys.stdin.readline

N = int(readline())
L = list(map(int,readline().split()))

L = sorted(L)

ans = 0
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    for k in range(j + 1, N):
      if len(set([L[i],L[j],L[k]])) != 3:
        continue
      if L[i] + L[j] > L[k]:
        ans += 1
        
print(ans)

N = int(input())
L = list(map(int, input().split()))

if N < 3:
    print(0)
    return

L = sorted(L)

res = 0
for k in range(N):
    for j in range(k):
        for i in range(j):
            if L[i] == L[j] or L[j] == L[k] or L[k] == L[i] : 
                continue
            if L[i] + L[j] <= L[k]:
                continue
            res += 1
            #print("{} {} {}".format(L[i], L[j], L[k]))

print(res)

from sys import stdin
N = int(stdin.readline().rstrip())
L = sorted([int(_) for _ in stdin.readline().rstrip().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] > L[k] > L[j] > L[i]:
                ans += 1
print(ans)

n = int(input())
b = list(map(int, input().split()))

x = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):  
      if b[i] != b[j] and b[j] != b[k] and b[k] != b[i]:
        if b[i] < b[j] + b[k] and b[j] < b[i] + b[k] and b[k] < b[i] + b[j]:
          x += 1
         
print(x)

N = int(input())
hen = []

hen = list(int(x) for x in input().split())
hen.sort()
#print(hen)
#hen_u = set(hen)
#print(hen_u)
tri = 0

for a in hen:
    for b in hen:
        if(a == b)or (a > b):
            continue
        for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1

print(tri)

N = int(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] and L[i]+L[j]>L[k] : ans += 1

print(ans)

from collections import Counter
N = int(input())
L = list(map(int, input().split()))
C = Counter(L)
L = sorted(set(L))
M = len(L)
ans = 0
for i in range(M):
    for j in range(i + 1, M):
        for k in range(j + 1, M):
            a, b, c = L[i], L[j], L[k]
            if a < b + c and b < c + a and c < a + b:
                ans += C[a] * C[b] * C[c]

print(ans)


n=int(input())
l=list(map(int, input().split()))
count=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 abs(l[j]-l[k])<l[i]<l[j]+l[k]:
          count+=1
print(count)

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

N = int(input())
L = list(map(int,input().split()))
sum = 0

for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      #print('i:'+str(i)+',j:'+str(j)+',k:'+str(k))
      if(L[i]+L[j]>L[k]) and (L[i]+L[k]>L[j]) and (L[j]+L[k]>L[i]) and (L[i]!=L[j])and (L[i]!=L[k])and (L[k]!=L[j]):
        #print('a\n')
        sum+=1

print(sum)

N = int(input())
L = list(map(int, input().split()))

count = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            temp = set([L[i], L[j], L[k]])
            if len(temp) != 3:
                continue
            ma = max(temp)
            if ma < sum(temp - {ma}):
                count += 1
print(count)


# Nを取得する
N = int(input())

# L1〜LNをリストとして取得する
L = list(map(int, input().split()))

# Lの3つの値の組み合わせ全てに対して、三角形の条件を検証する
counter = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            # Li, Lj, Lkの値が全て異なることなり、三角形の条件を満たすならカウント＋１ 
            if len(set([L[i], L[j], L[k]])) == 3 and L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j]:
                counter += 1

# 結果を表示
print(counter)

def solve(n, l):
    l = sorted(l)
    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]) and (l[i] + l[j] > l[k]):
                    ans += 1
    return ans

n = int(input())
l = list(map(int, input().split()))
print((solve(n, l)))


N = int(input())
L = list(map(int, input().split()))
#print(N, L)
count = 0
for i in range(0, N-2):
    for j in range(1, N-1):
        for k in range(2, N):
            #三盆の長さが同じでない，かつ，「ある一本より他の二本の和が大きい」が常に成り立つ
            if (i<j)&(j<k)&(L[i]!=L[j])&(L[j]!=L[k])&(L[k]!=L[i]) & ((L[i]+L[j]>L[k])&(L[j]+L[k]>L[i])&(L[k]+L[i]>L[j])):
                #print(i, j, k)
                count += 1
print(count)


from itertools import *
_,L=open(0);print(sum(sum(t)>2*max(t)for t in combinations(map(int,L.split()),3)if len(set(t))==3))

N=int(input())
L=list(map(int,input().split()))
result=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 (L[i]<L[j]+L[k] and L[j]<L[i]+L[k] and L[k]<L[i]+L[j]):
        result+=1
print(result)

import itertools
N=int(input())
a=list(map(int, input().split()))
a_=list(itertools.combinations(a,3))
count=0
for i in a_:
  if(len(set(i)) == 3):
    if(i[0]+i[1]>i[2] and i[0]+i[2]>i[1] and i[1]+i[2]>i[0]):
      count=count+1
print (count)

n = int(input())
l = list(map(int, input().split()))
len_l = len(l)

ans = 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):
            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)

n=int(input())

lis=list(map(int,input().split()))
a=0
b=0
c=0
output=0
for i in range(len(lis)):
  a=lis[i]
  for j in range(i+1,len(lis)):
    b=lis[j]
    for k in range(j+1,len(lis)):
      c=lis[k]
      if a+b>c and a+c>b and b+c>a and (a!=b and b!=c and c!=a) :
        output+=1
print(output)

n = int(input())
ls = list(map(int, input().split()))

count = 0

for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            a, b, c = ls[i], ls[j], ls[k]
            if (a + b > c and b + c > a and c + a > b) and (a != b and b != c and c != a):
                count += 1

print(count)


N = int(input())

L = list(map(int, input().split()))
L_sort = sorted(L)
Y_count = 0
N_count = 0

import itertools
for x in itertools.combinations(L_sort, 3):
  if x[0] != x[1] and x[1] != x[2] and x[0]!= x[2] and x[0]+ x[1] >+ x[2] and x[1]+x[2] >= x[0] and x[0]+x[2] >= x[1]:
    Y_count = Y_count +1
  else:
    N_count = N_count +1

print(Y_count)

n = int(input())
lll = list(map(int, input().split()))
lll.sort()
len_lll = len(lll)
ans = 0
for i in range(len_lll):
    a = lll[i]
    for j in range(i + 1, len_lll):
        b = lll[j]
        for k in range(j + 1, len_lll):
            c = lll[k]
            if a + b > c and a != b and b != c:
                ans += 1
print(ans)

n = int(input())
n_l = list(map(int, input().split()))

ans = 0
n_l.sort()

for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if n_l[i] != n_l[j] != n_l[k] and n_l[i] + n_l[j] > n_l[k]:
                ans += 1

print(ans)

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

n=int(input())
a=list(map(int,input().split()))
hasil=0
a=sorted(a)
for x in range(n-2):
    for y in range(x+1,n-1):
        for z in range(y+1,n):
            if a[x]!=a[y] and a[y]!=a[z] and a[z]!=a[x]:
                if a[x]+a[y]>a[z]:
                    hasil=hasil+1
print(hasil)

N = int(input())
L = list(map(int,input().split()))
count = 0

if N <= 2:
    count += 0

else:
    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] and L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[k] + L[i] > L[j]:
                    count += 1

print(count)

n = int(input())
l = list(map(int, input().split()))

count = 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]) and (l[j] + l[k] > l[i]) and (l[i] + l[k] > l[j]) and (l[i] != l[j]) and (l[j] != l[k]) and (l[i] != l[k]):
        count += 1
print(count)


N = int(input())
L = list(map(int, input().split()))
Ls = sorted(L)
ans = 0

for i in range(N):
	for j in range(i+1, N):
		for k in range(j+1, N):
			if Ls[i] < Ls[j] < Ls[k] and Ls[k] < Ls[i] + Ls[j]:
				ans += 1

print(ans)

n=int(input())  #->n=5
L = list(map(int,input().split()))
count = 0
for i in range(n):
    for j in range(n):
        for k in range(n):
            if not (i<j<k): continue
            if len(set([L[i],L[j],L[k]])) < 3: continue
            if (L[i]+L[j] > L[k]) and (L[j]+L[k] > L[i]) and (L[k]+L[i] > L[j]):
                count += 1

print(count)