Problem:
 Score : 200 points    Problem Statement 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 1 5
4 4 9 7 5      Sample Output 1 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) .       Sample Input 2 6
4 5 4 3 3 5      Sample Output 2 8  We have two sticks for each of the lengths 3 , 4 , and 5 . To satisfy the first condition, we have to choose one from each length.  There is a triangle whose sides have lengths 3 , 4 , and 5 , so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.       Sample Input 3 10
9 4 6 1 9 6 10 6 6 8      Sample Output 3 39       Sample Input 4 2
1 1      Sample Output 4 0  No triple (i, j, k) satisfies 1 \leq i < j < k \leq N , so we should print 0 .

Solution (Python):

import datetime
from decimal import Decimal, ROUND_DOWN
import heapq
from fractions import gcd
from functools import reduce
from collections import deque

import itertools
import collections
import math
import sys
sys.setrecursionlimit(2000000)







n = int(input())


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








count = 0
data = []
for a, b, c in itertools.combinations(l, 3):
    if a+b > c and b+c > a and c+a > b:
        data.append([a, b, c])


for i in range(len(data)):
    if data[i][0] != data[i][1] and data[i][0] != data[i][2] and data[i][1] != data[i][2]:
        count += 1



print(count)

Solution (Python):
import itertools

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

C = list(itertools.combinations(L,3))

ans = 0
for a, b, c in C:
    if a < b + c and b < a + c and c < b + a and a != b and b != c and a != c:
        ans += 1
print(ans)

Solution (Python):
import itertools

n = int(input())

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

combi = list(itertools.combinations(l, 3))
cnt = 0

for i in range(len(combi)):
  if combi[i][0] != combi[i][1] != combi[i][2] != combi[i][0] and max(combi[i])*2 < sum(combi[i]):
    cnt +=1

print(cnt)

Solution (Python):
import collections

N=int(input())
l=list(map(int,input().split()))
c=collections.Counter(l)

c=sorted(c.items(),key=lambda x:x[0])

item=[]
num=[]

for i,n in c:
    item.append(i)
    num.append(n)
    
count=0

if N<3:
    print(0)
else:
    for i in range(len(item)-2):
        for j in range(i+1,len(item)-1):
            k=j+1
            sumij=item[i]+item[j]
            mulij=num[i]*num[j]
            while k<len(item) and item[k]<sumij:
                count+=mulij*num[k]
                k+=1
    print(count)

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

Solution (Python):
import itertools

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

def valid(a, b, c):
    x = max(a, b, c)
    return x < a+b+c-x and len({a, b, c}) == 3

ways = 0
for i, j, k in itertools.combinations(range(N), 3):
    if valid(L[i], L[j], L[k]):
        ways += 1

print(ways)

Solution (Python):
import itertools 
N=int(input())
L=list(map(int,input().split()))
result=[]
for pair in itertools.combinations(L, 3):
	result.append(list(pair))
count=0
for i in range(len(result)):
	result[i].sort()
	if result[i][0]!=result[i][1] and result[i][0]!=result[i][2] and result[i][1]!=result[i][2] and (result[i][0]+result[i][1])>result[i][2]:
		count+=1
print(count)

Solution (Python):



import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def std_in():
    return sys.stdin.readline().strip()


def main():
    n = int(std_in())
    l = list(get_ints())
    c = 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]:
                    s = {l[i], l[j], l[k]}
                    L = [l[i], l[j], l[k]]
                    L.sort()
                    if len(s) == 3:
                        if L[-1] < L[0] + L[1]:
                            c += 1
    print(c)


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)

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

Solution (Python):
n=int(input())
li=sorted(list(map(int, input().split())),reverse=1)
res=0
for x in range(n):
    for y in range(x+1,n):
        for z in range(y+1,n):
            a=li[x]
            b=li[y]
            c=li[z]
            if (a<b+c) and a!=b and b!=c:
                res+=1
print(res)

Solution (Python):
def main():
    n = int(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 0<= i < j < k <= n-1 \
                    and 2 * max([l[i], l[j], l[k]]) < sum([l[i], l[j], l[k]]) \
                    and len(set([l[i], l[j], l[k]]))==3:
                    ans += 1
    print(ans)

    
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = 0
l = list(map(int, input().split()))
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for z in range(j+1, n):
            ma = max(l[i], l[j], l[z])
            mi = min(l[i], l[j], l[z])
            mm = (l[i] + l[j] + l[z])-ma-mi
            if mm-mi < ma and ma < mi+mm and l[i] != l[j] and l[j] != l[z] and l[i] != l[z]:
                ans += 1
                

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

N=int(input().rstrip('\n'))
if N<3:
  print(0)
else:
  ls = [int(x) for x in input().rstrip('\n').split()]
  ls = sorted(ls,reverse = True)
  res = 0
  for x in range(N-2):
    X=ls[x]
    for y in range(x+1,N-1):
      Y=ls[y]
      if X>Y:
        a = X-Y
        for z in range(y+1,N):
          Z=ls[z]
          if Y>Z and Z>a:
            res += 1
          elif Z<=a:
            break
  print(res)

Solution (Python):
import os

from itertools import combinations
n=int(input())
ls=list(map(int,input().split()))

cnt = 0
for a,b,c in combinations(ls, 3):
    if a == b or b == c or c == a:
        continue
    if a+b > c and b+c > a and c+a>b:
        cnt += 1
print(cnt)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    ans = 0
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                tmp = []
                tmp.append(L[i])
                tmp.append(L[j])
                tmp.append(L[k])
                x = set(tmp)
                if len(x) != 3:
                    continue
                tmp.sort()
                if tmp[2] < tmp[1] + tmp[0]:
                    ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
L=[int(i) for i in input().split()]
cnt = 0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            
            if not ((L[i] == L[j]) or (L[j]==L[k]) or (L[i]==L[k])):
                mx = max(L[i],L[j],L[k])
                s = L[i]+L[j]+L[k]-mx-mx
                if s > 0:
                    cnt += 1
print(cnt)

Solution (Python):


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


main()

Solution (Python):
n = int(input())

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

con = 0

for p in range(n):
    for q in range(p+1,n):
        for r in range(q+1,n):
            if x[p] != x[q] and x[q] != x[r] and x[r] < (x[p] + x[q]) and x[q] < (x[p] + x[r]) and (x[r]-x[p]) < x[q] and (x[r]-x[q]) < x[p] and (x[q]-x[p]) < x[r]:
                con += 1
                
print(con);

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, combinations, chain, product
from functools import lru_cache
from collections import deque, defaultdict
from operator import itemgetter
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'



def main():
    N=ii()
    L=lmis()
    L.sort()
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                a, b, c = L[i], L[j], L[k]
                if a!=b!=c!=a:
                    
                    if a+b > c:
                        
                        ans += 1
    print(ans)


main()

Solution (Python):
import itertools

def canMakeTriangle(x,y,z):
    if x == y or x == z or y == z:
        return False
    elif x+y>z and y+z>x and z+x>y:
        return True
    else:
        return False


def resolve():
    _ = int(input())
    L = list(map(int, input().split()))
    cnt = 0
    for l in itertools.combinations(L,3):
        if canMakeTriangle(l[0], l[1], l[2]):
           cnt += 1

    print(cnt) 
    
resolve()

Solution (Python):
if __name__ == '__main__':

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

	cnt = 0
	for i in range(n):
		for j in range(i+1,n):
			for k in range(j+1,n):
				if A[i] != A[j] and A[j] != A[k] and A[i] != A[k]:
					if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j]:
						cnt += 1
	print(cnt)

Solution (Python):
N = int(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] or L[j] == L[k] or L[k] == L[i]:
                continue
            l = [L[i], L[j], L[k]]
            l.sort()
            if l[0] + l[1] > l[2]:
                ans += 1

print(ans)

Solution (Python):
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[k]!=l[j]:
        if l[k]<l[i]+l[j]:
          ans+=1
print(ans)

Solution (Python):
from itertools import combinations

input()
l = sorted(map(int, input().split()))
print(sum(a + b > c and a != b != c != a for a, b, c in combinations(l, 3)))

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
verbose = False
L.sort(reverse=True)

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

Solution (Python):
from itertools import combinations

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

res = 0
for i, j, k in combinations(l, 3):
    if i != j != k != i:
        if i < j + k and j < i + k and k < i + j:
            res += 1
print(res)

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))



def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  
from functools import reduce


N = a_int()
L = ints()
L.sort()
cnt = 0
for i, j, k in combinations(ra(N), r=3):
    if L[k] < L[j] + L[i] and L[i] != L[j] and L[j] != L[k] and L[i] != L[k]:
        cnt += 1
print(cnt)

Solution (Python):
N = int(input())
L = list([int(x) for x in 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[i] != L[k] and L[j] != L[k]:
                if abs(L[i] - L[j]) < L[k]:
                    if L[i] + L[j] > L[k]:
                        count += 1

print(count)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
res=0
if(n<2):
    print(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]):
                    if(l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[k]+l[i]>l[j]):
                        res+=1
    print(res)

Solution (Python):
from collections import Counter
from itertools import combinations

N = int(input())
if N == 0:
    print(0)
else:
    L = [int(s) for s in input().split()]

    set_L = Counter(L)

    uniq_L = set_L.keys()

    res = 0
    if len(uniq_L) < 3:
        print(res)
    else:
        for Li, Lj, Lk in combinations(uniq_L, 3):
            if Li + Lj > Lk and Li + Lk > Lj and Lj + Lk > Li:
                res += set_L[Li] * set_L[Lj] * set_L[Lk]

        print(res)

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

Solution (Python):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
l.sort()
ans = 0
for a in range(n):
    for b in range(a+1,n):
        for c in range(b+1,n):
            if l[a] != l[b] and l[b] != l[c] and l[c] != l[a]:
                if l[a]+l[b] > l[c]:
                    ans += 1
print(ans)

Solution (Python):
import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors


n = ini()
l = inl()
ans = 0
for k in range(n):
    for j in range(k):
        if l[k] == l[j]:
            continue
        for i in range(j):
            if l[k] == l[i] or l[j] == l[i]:
                continue
            if l[j] + l[i] <= l[k] or l[k] + l[i] <= l[j] or l[j] + l[k] <= l[i]:
                continue
            ans += 1
print(ans)

Solution (Python):
from bisect import bisect_left

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

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

Solution (Python):
def main():
    n = int(input())
    l = list(map(int, input().split()))

    if n <= 2:
        print(0)
        return 0
    
    l.sort(reverse=True)
    
    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] or l[j] == l[k]:
                    continue
                elif l[i] < l[j] + l[k]:
                    cnt += 1

    print(cnt)

    

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n):
    one = l[i]
    for j in range(i+1, n):
        two = l[j]
        if one == two:
            continue
        for k in range(j+1, n):
            three = l[k]
            if two == three:
                continue
            if one < two + three and two < one + three and three < one + two:
                ans += 1
print(ans)

Solution (Python):
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]:
                if L[i]+L[j] > L[k] and L[i]+L[k] > L[j] and L[k]+L[j] > L[i]:
                    ans += 1
                
print(ans)

Solution (Python):
from itertools import *
n = int(input())
Ls = list(map(int, input().split()))
ans = 0
if n <= 2:
  print('0')
  exit()
else:
  for v in combinations(Ls, 3):
    l = list(v)
    l.sort(reverse = False)
    if l[2] < l[1] + l[0] and len(set(l)) == 3:
      ans += 1
print(ans)

Solution (Python):
import collections
import itertools
n = int(input())
l = list(map(int, input().split()))

l_col = collections.Counter(l)
keys = list(l_col.keys())
res = 0
for x in itertools.combinations(keys, 3):
    if max(x)*2 < sum(x):
        c = 1
        for d in x:
            c *= l_col[d]
        res += c
print(res)

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L = sorted(L, reverse = False)

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

Solution (Python):
import collections
import itertools

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

l = list(set(a))
ans = 0
for v in itertools.combinations(a,3):
    x,y,z = v[0],v[1],v[2]
    if x != y and y != z and z !=x:
        if (x+y+z-max(x,y,z)) - max(x,y,z) > 0:
            ans += 1

print(ans)

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

from itertools import combinations
count = 0
for seq in combinations(range(0, n), 3):
  if l[seq[0]] + l[seq[1]] <= l[seq[2]]:
    continue
  if l[seq[0]] + l[seq[2]] <= l[seq[1]]:
    continue
  if l[seq[2]] + l[seq[1]] <= l[seq[0]]:
    continue
  if l[seq[0]] == l[seq[1]]:
    continue
  if l[seq[2]] == l[seq[1]]:
    continue
  if l[seq[2]] == l[seq[0]]:
    continue
  
  count += 1
print(count)

Solution (Python):
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[k]+a[j] > a[i] and a[i] != a[j] and a[j]!=a[k]:
                ans += 1
print(ans)

Solution (Python):


"""
Created on Sat Aug 15 17:30:06 2020

@author: divyarth
"""

import sys
import heapq
import math





from collections import deque
from collections import defaultdict
from collections import Counter

modH=int(10**9)+7
I=lambda : list(map(int,input().split(' ')))
def PRINT(lst,sep=' '): print(sep.join(map(str,lst)))


'''
s=input()
stack=[]
mm=0
for i in range(len(s)):
    if s[i]=='R':
        stack.append('R')
    else:
        cnt=0
        while len(stack):
            stack.pop()
            cnt+=1
        mm=max(mm,cnt)        
cnt=0
while len(stack):
    stack.pop()
    cnt+=1
mm=max(mm,cnt)
print(mm)

    
'''
n=int(input())
lst=I()

if len(lst)<=2:
    print(0)
else:
    ans=0
    for i in range(len(lst)-2):
        for j in range(i+1,len(lst)-1):
            for k in range(j+1,len(lst)):
                a,b,c=sorted([lst[i],lst[j],lst[k]])
                if c<b+a and a!=b and b!=c and c!=a:
                    ans+=1
    print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(len(a)):
        for j in range(i, len(a)):
            for k in range(j,len(a)):            
                if i == j or j == k:
                    pass
                else:
                    if (a[i] <(a[j]+a[k])) and (a[j] <(a[i]+a[k])) and (a[k] <(a[j]+a[i])) and (a[i] != a[j]) and a[j] != a[k] and a[k] != a[i]:
                        ans += 1
                    else:
                        pass

print(ans)

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

l = sorted(l)

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

print(count)

Solution (Python):
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] > L[k]) & (L[i] + L[k] > L[j]) & (L[j] + L[k] > L[i]) & (L[i] != L[j]) & (L[j] != L[k]) & (L[i] != L[k]):
                ans +=+1
print(ans)

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
cnt=0
for i in range(a-2):
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if not b[i]==b[j] and not b[j]==b[k] and not b[k]==b[i]:
        if b[i]+b[k]>b[j] and b[k]+b[j]>b[i] and b[i]+b[j]>b[k]:
          cnt+=1
print(cnt)

Solution (Python):
from itertools import combinations as combo

def check_tri(c):
    c = list(c)
    if len(set(c)) != 3:
        return False
    else:
        c.sort()
        if c[0] + c[1] > c[2]:  return True
        else:   return False



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

ans = 0

for i in tri:
    a = check_tri(i)
    if a:
        ans += 1

print(ans)

Solution (Python):
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):
            bar = []
            bar.append(L[i])
            bar.append(L[j])
            bar.append(L[k])
            bar.sort()
            if bar[0] == bar[1] or bar[1] == bar[2]:
                continue
            if bar[2] >= bar[0] + bar[1]:
                continue
            count += 1
print(count)

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

ans = 0
for no1,l1 in enumerate(L):
  for no2, l2 in enumerate(L):
    for no3, l3 in enumerate(L):
      if (no1 < no2) and (no2 < no3):
        sort_L = sorted( [l1,l2,l3] ) 
        if (len(set(sort_L )) == 3) and (sort_L[0] + sort_L[1] > sort_L[2]):
          ans += 1
      else:
        continue
print( ans )

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

cnt = 0
for i in range(n-2):
    for j in range(1, n-1):
        for k in range(2, n):
            ijk = sorted([l[i], l[j], l[k]])
            if not i < j < k:
                continue
            if len(set(ijk)) != 3:
                continue
            if ijk[0]+ijk[1] > ijk[2]:
                cnt += 1

print(cnt)

Solution (Python):
n = int(input())
li = list(map(int, input().split()))

if n <= 2:
    print(0)
else:
    cnt = 0

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

                l = sorted([li[i], li[j], li[k]])

                if l[0] + l[1] > l[2]:
                    cnt += 1

    print(cnt)

Solution (Python):
N = int(input())
List = list(map(int,input().split()))
counter = 0
for i in range(N-2):
  for j in range(i+1,N-1):
    for k in range(j+1,N):
      if List[i] != List[j] and List[j] != List[k] and List[k] != List[i]:
        if abs(List[j] - List[i]) < List[k] < List[i] + List[j]:
          if abs(List[k] - List[j]) < List[i] < List[k] + List[j]:
            
            counter += 1
print(counter)

Solution (Python):
n = int(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):
            len = l[i]+l[j]+l[k]
            ma = max(l[i],max(l[j],l[k]))
            res = len - ma
            if ma<res and l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
                ans += 1
                
print(ans)

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

cnt = 0
for i in range(N):
    li = L[i]
    for j in range(i + 1, N):
        lj = L[j]
        if li == lj: continue
        for k in range(j + 1, N):
            lk = L[k]
            if li == lk or lj == lk: continue
            if li + lj > lk:
                cnt += 1

print(cnt)

Solution (Python):
def main():
    N = int(input())
    L = list(map(int,input().split()))
    list.sort(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 L[i] != L[j] and L[k] != L[j] and L[i] != L[k]:
                    if L[i]+L[j]>L[k]:
                        ans += 1
                    
    
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
import itertools


def dbg(s):
    
    pass


N = int(input())
Ls = [int(i) for i in input().split()]


def is_ok(i, j, k):
    dbg(f"{i=},{j=},{k=}")
    if not (i != j and j != k and i != k):
        return False
    ls = [i, j, k]
    ls.sort()
    dbg(f"{ls=}")
    return ls[2] < ls[0] + ls[1]


count = 0
for tri in itertools.combinations(Ls, 3):
    if is_ok(tri[0], tri[1], tri[2]):
        count += 1

print(count)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
count = 0
for i in range(n):
    a = l[i]
    for j in range(n-i-1):
        b = l[i+1+j]
        for k in range(n-i-j-2):
            c = l[i+1+j+1+k]
            if a != b and a != c and b != c:
                test = [a,b,c]
                test.sort()
                if test[2] < test[0] + test[1]:
                    count += 1
print(count)

Solution (Python):
N = int(input())

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

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

      if i < j and j < k:
        if L[i] == L[k]:
          continue

        if L[j] == L[k]:
          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)

Solution (Python):
N = int(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):
        for k in range(j+1,N):
            if L[i]+L[j] > L[k] and (L[i]!=L[j] and L[j]!=L[k] and L[i]!=L[k]):
                count += 1
print(count)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
count=0

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

Solution (Python):
from itertools import combinations as comb
def main():
    N = int(input())
    L = list(map(int, input().split()))
    count = 0
    for a, b, c in comb(L, 3):
        a, b, c = sorted([a, b, c])
        if a == b or b == c or c == a:
            continue
        if c < a + b:
            count += 1
    print(count)
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
L = sorted(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] or L[j] == L[k]:
                pass
            elif L[i] + L[j] > L[k]:
                ans += 1
print(ans)

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

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

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

def judge(i, j, k):
    return (i + j > k) and (j + k > i) and (k + i > j) and (i != j) and (j != k) and (k != i)


sum = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            if (i == j or j == k or k == i):
                continue
            else:
                if (judge(L[i], L[j], L[k])):
                    sum += 1

print(sum)