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 sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	n = int(input())
	
	
	al = lin()
	al.sort()
	r=0
	for i, vi in enumerate(al):
		for j, vj in enumerate(al[i:],i):
			if vi == vj:
				continue
			for vk in al[j:]:
				if vi == vk:
					pass
				elif vj == vk:
					pass
				elif vi + vj <= vk:
					pass
				else:
					r+=1
	return r
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
def main():
    n = int(input())
    l = list(map(int, input().split()))
    count = 0
    if n < 3:
        return 0
    else:
        for i in range(n-2):
            for j in range(i+1, n):
                for k in range(j+1, n):
                    select = [l[i], l[j], l[k]]
                    
                    
                    
                    
                    
                    
                    if (len(select) == len(set(select))) and (max(select)*2 < sum(select)):
                        count += 1
        return count


if __name__ == "__main__":
    print(main())

Solution (Python):
N=int(input())
X = list(map(int,input().split()))
Y=set(X)
Z=list(Y)
NN=len(Z)
AA=0
for i in range(NN-2):
  for ii in range(NN-2-i):
    for iii in range(NN-2-i-ii):
      A=[Z[i], Z[ii+i+1], Z[iii+ii+i+2]]
      if max(A)<Z[i]+Z[ii+i+1]+Z[iii+ii+i+2]-max(A):
        AA+=X.count(Z[i])*X.count(Z[ii+i+1])*X.count(Z[iii+ii+i+2])
if N<3:
  print(0)
else:
  print(AA)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l_1 = sorted(l)[::-1]
cnt = 0
for i in range(n):
    kizyun = l_1[i]
    for j in range(i+1, n):
        kizyun_2 = l_1[j]
        for k in range(j+1, n):
            kizyun_3 = l_1[k]
            if kizyun_2-kizyun_3 < kizyun < kizyun_2+kizyun_3 and l_1[i] != l_1[j] != l_1[k]:
                cnt += 1
print(cnt)

Solution (Python):











import sys
def _p(*_a):
  
  _s=" ".join(map(str,_a))
  
  sys.stderr.write(_s+"\n")

def _pa(_aa):
  
  for _a in _aa: _p(_a)

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

L.sort()

from collections import Counter
A = Counter(L)
K = list(A.keys())





ans = 0

for i in range(len(K)):
  
  for j in range(i+1,len(K)):
    
    for k in range(j+1,len(K)):
      
      if K[i] + K[j] > K[k]:
        
        
        ans += A[K[i]] * A[K[j]] * A[K[k]]

print(ans)

Solution (Python):
import itertools
N = int(input())
L = map(int, input().split())
ans = 0
for c in itertools.combinations(L, 3):
  c = sorted(c)
  if c[0] < c[1] and c[1] < c[2] and c[0]+c[1] > c[2] and c[1]+c[2] > c[0] and c[2]+c[0] > c[1]:
    ans += 1
    
print(ans)

Solution (Python):
import itertools

n = int(input())
l = list(map(int, input().split()))
p = itertools.combinations(l, 3)
count = 0

for x in p:
    a, b, c = x[0], x[1], x[2]
    if a == b or b == c or a == c:
        continue
    if a + b > c and b + c > a and a + c > b:
        count += 1

print(count)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = int(input())

ans = 0

L = LI()

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] and L[k] != L[j] 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 = ans + 1

print(str(ans))

Solution (Python):

import itertools


n = int(input())


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


if (n < 3):
  print(0)
  exit()


count = 0
for data in itertools.combinations(lods, 3):
  if (data[0] != data[1]
      and data[1] != data[2]
      and data[2] != data[0]
      and (data[0]+data[1]) > data[2]
      and (data[1]+data[2]) > data[0]
      and (data[2]+data[0]) > data[1]):
    count += 1

print(count)

Solution (Python):
import itertools
N = int(input())
L = [int(i) for i in input().split()]
cnt = 0
for v in itertools.combinations(L, 3):
    if (
        (len(set(v)) == 3) and
        (v[0] + v[1] > v[2]) and 
        (v[1] + v[2] > v[0]) and 
        (v[0] + v[2] > v[1])
    ):
         cnt = cnt + 1
print(cnt)

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

count = 0

temp = []
temp2 = []
while len(L)>=3:
    a = L.pop()
    while len(L)>=2:
        b = L.pop()
        temp2.insert(0, b)
        if b == a:
            continue
        while L:
            c = L.pop()
            temp.insert(0, c)
            if c==b:
                continue
            if c >= a+b:
                break
            count +=1
        L = L + temp
        temp.clear()
    L.extend(temp2)
    temp2.clear()


print(count)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
if(n<3):
    print(0)
else:
    p = 0
    for i in range(2,n):
        for j in range(1,i):
            for k in range(j):
                if(l[i] != l[j] and l[j] != l[k] and l[k] != l[i]):
                    if(l[i]+l[j]+l[k] > 2*max(l[i],l[j],l[k])):
                        p += 1
    print(p)

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

Solution (Python):
def B(N, L):
    if N < 3:
        return 0

    answer = 0

    for i in range(0, N - 2):
        if L[i] < 1:
            continue
        for j in range(1, N - 1):
            if i >= j or L[i] == L[j]:
                continue
            for k in range(2, N):
                if i >= k or j >= k or L[i] == L[k] or 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]:
                    answer += 1

    return answer
  
  
N = int(input())
L = [int(n) for n in input().split(' ')]
print(B(N, L))

Solution (Python):
import math
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]):
                if(L[i]!=L[k]):
                    if(L[j]!=L[k]):
                        ans+=1
                        print('{},{},{}'.format(i,j,k))
            else:
                break
print(ans)
'''
count=0
ss=[]
S=[0]*N
for i in range(len(L)):
    if(not (L[i] in ss)):

        ss.append(L[i])
        if(S[ss.index(L[i])]==0):
            S[ss.index(L[i])]=1
    else:

        S[ss.index(L[i])]=S[ss.index(L[i])]+1

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

ans=0
for i in range(len(ss)-2):
    for j in range(i+1,len(ss)-1):
        for k in range(j+1,len(ss)):
            if(ss[i]+ss[j]>ss[k] and ss[j]+ss[k]>ss[i] and ss[k]+ss[i]>ss[j]):
                ans=ans+S[i]*S[j]*S[k]

print(ans)
'''
print(count)
print(combinations_count(count, 3))
'''

Solution (Python):
n = int(input())
ls = list(map(int, input().split()))
if n < 3:
    print(0)
    exit()
def checkValidity(a, b, c):  
    
    if (a + b <= c) or (a + c <= b) or (b + c <= a) : 
        return False
    else: 
        return True  
r = 0
for i in range(n):
    for j in range(i+1, n):
        if ls[i] != ls[j]:
            for k in range(j+1, n):
                if ls[j] != ls[k] and ls[k] != ls[i]:
                    if checkValidity(ls[i],ls[j],ls[k]):
                        r += 1

print(r)

Solution (Python):
import itertools
n = int(input())
l = list(map(int, input().split()))
ans = 0
for a, b, c in itertools.combinations(l, 3):
    if a != b and b != c and a != c:
        if abs(a-b) < c < a+b:
            ans += 1
print(ans)

Solution (Python):
import itertools

n=int(input())
L=list(map(int,input().split()))
M=[]
N=[]

for v in itertools.combinations(L,3):
    M.append(list(map(int,v)))

if n==1 or n==2:
       print(0)
else :
    for i in range(len(M)):
        if M[i][0]==M[i][1] or M[i][0]==M[i][2] or M[i][1]==M[i][2]:
            continue
        if M[i][0]+M[i][1]>M[i][2] and M[i][0]+M[i][2]>M[i][1] and M[i][1]+M[i][2]>M[i][0]:
            N.append(M[i])
    print(len(N))

Solution (Python):
n,m=int(input()),list(map(int,input().split()))
m.sort()
c=0
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if m[i]+m[j]>m[k]:
                if m[i]!=m[j] and m[i]!=m[k] and m[j]!=m[k]:
                    c+=1
            else:
                break
print(c)

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

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

L = sorted(L, reverse=True)
cnt=0
for i in range(len(L)-2):
    a = L[i]
    for j in range(i+1,len(L)-1):
        b = L[j]
        if a==b:
            continue
        for k in range(j+1, len(L)):
            c=L[k]
            if b==c:
                continue
            if a < b+c:
                cnt+=1
print(cnt)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort()
d=dict()
for i in l:
  if i in d:
    d[i]+=1
  else:
    d[i]=1

li=list(d.keys()) 
ans=0
for i in range(len(li)-1,0,-1):
  a,b=0,i-1
  while(a<b):
    if li[a]+li[b]>li[i]:
      
      for kk in range(a,b):
      	ans+=d[li[kk]]*d[li[b]]*d[li[i]]
      b-=1
    else:
      a+=1
print(ans)

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

import itertools
if N<3:
  print(0)
else:
  count=0
  h = itertools.combinations(L, 3)
  for v in h:
    lst=sorted(list(v))
    if lst[0]+lst[1]>lst[2]:
      if lst.count(lst[0])==1:
        if lst.count(lst[1])==1:
          if lst.count(lst[2])==1:
            count+=1
  print(count)

Solution (Python):
import itertools as it
n = int(input())
l = list(map(int, input().split()))
s = []
ans = 0
l.sort()
seed = list(range(0,n))
cmt = list(it.combinations(seed, 3))
for i in range(len(cmt)):
  a = cmt[i]
  if l[a[1]] + l[a[0]] > l[a[2]] and l[a[0]] != l[a[1]] and l[a[1]] != l[a[2]] and l[a[0]] != l[a[2]]:
    ans += 1
print (ans)

Solution (Python):
N = int(input()) 
list = list(map(int, input().split()))
i=0
j=1
k=2
kosuu=0

while i<=N-3:
  while j<=N-2:
    while k<=N-1:
      x=list[i]
      y=list[j]
      z=list[k]
      if x+y>z and y+z>x and z+x>y and x!=y and y!=z and z!=x:
        kosuu+=1
      k+=1
      
    j+=1
    k=j+1
  i+=1
  j=i+1
  k=j+1
print(kosuu)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
A.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 A[i]+A[j]>A[k]:
        if A[i]!=A[j] and A[j]!=A[k]:
          ans+=1
      else:
        break
print(ans)

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

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

L.sort(reverse=True)

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

print(cnt)

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    N = int(input())
    L = list(map(int,input().split()))
    ans = 0
    for i in L:
        for j in L:
            for k in L:
                if i < j and j < k and (i+j) > k and (i+k) > j and (j+k) >i:
                    ans +=1
    print(ans)




    
if __name__ == "__main__":
    main()

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


def solve():
    if n < 3:
        return 0

    llen = len(ls)
    cnt = 0
    

    for i in range(0, llen):
        for j in range(0, llen):
            for k in range(0, llen):
                if not (i < j < k):
                    continue

                xs = [ls[i], ls[j], ls[k]]
                xs.sort()
                ii, jj, kk = xs
                if len(set(xs)) < 3:
                    continue

                if ii + jj > kk and jj + kk > ii and kk + ii > jj:
                    
                    cnt += 1

    return cnt


print(solve())

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

Solution (Python):



import bisect

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):
            
            a=min(L[i],L[j],L[k])
            c=max(L[i],L[j],L[k])
            b=(L[i]+L[j]+L[k]-a-c)
            if a+b>c and a<b<c:
                ans+=1

print(ans)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
c = 0
if N == 1 or N ==2 :
  c == 0
else:
  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] and L[j] != L[k] and L[k] != L[i] :
          l = [L[i], L[j], L[k]]
          ld = sorted(l, reverse=True)
          if ld[0] < ld[1] + ld[2]:
            c = c + 1

print(c)

Solution (Python):
import itertools

N = int(input().strip())
L = [int(i) for i in input().strip().split(' ')]

cnt = 0
for i in itertools.combinations(L, r=3):
  i = sorted(i)
  if len(set(i)) == 3:
    if sum(i[:2]) > i[2]:
      cnt += 1

print(cnt)

Solution (Python):
import sys
import math
import itertools

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

cnt = 0

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

for l in L:
    if l[0] + l[1] > l[2] and l[1] + l[2] > l[0] and l[2] + l[0] > l[1] and l[0] != l[1] and l[1] != l[2] and l[2] != l[0]:
        cnt += 1

print(cnt)

Solution (Python):
import collections
N = int(input())
L = list(map(int, input().split()))
L = collections.Counter(L)
L = list(L.items())
L = sorted(L)
N = len(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][0]+L[j][0] > L[k][0]:
                ans += L[i][1]*L[j][1]*L[k][1]

print(ans)

Solution (Python):
import itertools
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)
count = 0
ans = list(itertools.combinations(l, 3))
for i in ans:
    if i[0] + i[1] > i[2]:
        if len(i) == len(set(i)):
            count += 1

print(count)

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

for i in range(n):
    a = l[i]
    for j in range(n):
        b = l[j]
        for k in range(n):
            c = l[k]
            if i < j and j < k:
                m = [a,b,c]
                m = sorted(m)
                f = max(m)
                h = min(m)
                m.pop(0)
                m.pop(1)
                if f<m[0]+h and f != m[0] and m[0] != h:
                    cnt += 1
print(cnt)

Solution (Python):
x=eval(input())
num=sorted(list(map(int,input().split())))
res=0
for i in range(x):
    for j in range(i):
        for k in range(x-1,i,-1):
            if num[i]==num[j] or num[i]==num[k] or num[j]==num[k]:
                continue
            else:
                if num[j]-num[k]<num[i] and num[j]+num[i]>num[k]:
                    res+=1
print(res)

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
setL=set(L)
dicL=dict()
ans=0
for i in L:
    if i in dicL:
        dicL[i]+=1
    else:
        dicL[i]=1
L=list(setL)
length=len(L)
for i in range(length):
    for j in range(i+1,length):
        for k in range(j+1,length):
            if L[i]+L[j]>L[k] and L[i]+L[k]>L[j] and L[j]+L[k]>L[i]:
                ans+=dicL[L[i]]*dicL[L[j]]*dicL[L[k]]
print(ans)

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

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

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

cnt = 0

for suji in LL:
    a = suji[0]
    b = suji[1]
    c = suji[2]

    if a != b and b != c and c != a:
        if a + b > c and b + c > a and c + a > b:
            cnt = cnt + 1

print(cnt)

Solution (Python):
n = input()
if int(n) < 3:
  print(0)
  exit()
a = [int(i) for i in input().split()]
l = len(a)
sum = 0
s = 0
for i in range(l):
  for j in range(i + 1, l):
    for k in range(j + 1, l):
      if not (a[i] == a[j] or a[j] == a[k] or a[k] == a[i]):
        if (a[i] + a[j]) > a[k] and (a[j] + a[k]) > a[i] and (a[k] + a[i]) > a[j]:
          sum += 1
print(sum)

Solution (Python):
import numpy as np

N = int(input().rstrip())
if N > 3:
  line = input().rstrip().split()
  L = [int(i) for i in line]
  L.sort(reverse = True)

  count = 0

  for i in range(len(L)):
    for j in range(len(L)):
      for k in range(len(L)):
        if i != j and j != k and k != i:
          if i < j and j < k:
            x = L[i]
            y = L[j]
            z = L[k]
            if x < y+z:
              if y-z < x:
                if x != y and y != z and z !=x:
                  count += 1

  print(count)
  
else:
  print(0)

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

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

count = 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)):
      n1 = l[i]
      n2 = l[j]
      n3 = l[k]
      if n1 < n2 + n3 and n2 < n1 + n3 and n3 < n1 + n2:
        if n1 != n2 and n1 != n3 and n2 != n3:
          count = count + 1
      else:
        continue

print(count)

Solution (Python):

def main():
    n = int(input())
    l = list(map(int, input().split()))
    cnt = 0

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


if __name__ ==  "__main__":
    main()

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

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

print(c)

Solution (Python):
import itertools
N = int(input())
L = list(map(int,input().split()))
ans=0
for v in itertools.combinations(list(range(N)), 3):
  if max(L[v[0]],L[v[1]],L[v[2]])<L[v[0]]+L[v[1]]+L[v[2]]-max(L[v[0]],L[v[1]],L[v[2]]):
    if L[v[0]]!=L[v[1]] and L[v[1]]!=L[v[2]] and L[v[2]]!=L[v[0]]:
      ans+=1
    
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]




from itertools import combinations

N = ii()
A = li()
cnt = 0

for c in combinations(A, 3):
    c = sorted(c)
    if c[0] != c[1] and c[1] != c[2]:
        if c[0] + c[1] > c[2]:
            cnt += 1

print(cnt)

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



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

print(ans)

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
L.sort(reverse=True)
count=0
for x in L:
    for y in L:
        for z in L:
            if x<y+z and x>y and y>z:
                count+=1
print(count)

Solution (Python):
def main():
    import sys
    N=int(sys.stdin.readline())
    L=list(map(int,sys.stdin.readline().split()))
    count=0
    for i in L:
        for j in L:
            if i==j:
                continue
            for k in L:
                if i==k or j==k:
                    continue
                
                lst=sorted([i,j,k])
                if lst[2]<lst[1]+lst[0]:
                    count+=1
  
    print(count//6)
main()

Solution (Python):
N = int(input())
LL = list(map(int,input().split()))
cnt = 0
L = sorted(list(set(LL)))
for i in range(len(L)-2):
    for j in range(1, len(L)-1-i):
        for k in range(1, len(L)-i-j):


            if L[i] + L[i+j] > L[i+j+k] and L[i+j] - L[i] < L[i+j+k]:



                cnt += LL.count(L[i])*LL.count(L[i+j])*LL.count(L[i+j+k])
                
print(cnt)

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

count = 0
for i in L:
    for j in L:
        for k in L:
            if i < j < k:
                if i != j != k:
                    if (i + j > k) and (j + k > i) and (i + k > j):
                        count+=1

print(count)

Solution (Python):
import itertools

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

cnt = 0
for v in itertools.combinations(l, 3):
    t = set(v)
    if len(t) == len(v) and (abs(v[0] - v[1]) < v[2] < v[0] + v[1]):
        cnt += 1
print(cnt)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
counter = 0
for i in range(n-2):
	for k in range(n-2-i):
		for s in range(n-i-k-2):
			ak = k+i+1
			sa = k+i+s+2
			if l[i]+l[ak]>l[sa] and l[i]+l[sa]>l[ak] and l[sa]+l[ak]>l[i]:
				if l[i] != l[ak] and l[i] != l[sa] and l[ak] != l[sa]:
					counter += 1
print(counter)

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

Solution (Python):
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)

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

ans = 0

for i in range(len(L)):
    for k in range(i + 1, len(L), 1):
        for l in range(k + 1, len(L), 1):
            A = [L[i], L[k], L[l]]
            if (2 * max(A) < sum(A)) & (len(A) == len(set(A))):
                ans = ans + 1
print(ans)

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

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

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

Solution (Python):
import itertools

n = int(input())
nums = list(map(int, input().split()))
count = 0
for i, j, k in itertools.combinations(nums, 3):
    if i != j and i != k and j != k:
        L = [i, j, k]
        L = sorted(L)
        if L[2] < L[0] + L[1]:
            count += 1


print(count)

Solution (Python):
n = int(input())
data = list(map(int, input().split()))
result = 0
re = []

for i in range(len(data)):
  for j in range(i + 1, len(data)):
    for k in range(j + 1, len(data)):
      if data[i] == data[j] or data[i] == data[k] or data[j] == data[k] or data[i]== data[j] == data[k]:
        result += 0
      else:
        lists = [data[i],data[j],data[k]]
        lists = sorted(lists)
        if lists[0]+lists[1] > lists[2] :
          result += 1


print(result)

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[j] != l[k] and l[i] + l[j] > l[k]:
                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,n):
        for k in range(j,n):
            if l[i]+l[j]+l[k] - max(l[i],l[j],l[k]) > max(l[i],l[j],l[k]):
                if l[i] != l[j] and l[j]!= l[k] and l[i] !=l[k]:
                    ans+=1
print(ans)

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

cnt = 0

def all_not_equals(i, j, k):
    return li[i] != li[j] and li[j] != li[k] and li[k] != li[i]

def could_be_triangle(i, j, k):
    e = max(li[i], li[j], li[k])

    return ((li[i] + li[j] + li[k]) - e) > e

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if all_not_equals(i, j, k) and could_be_triangle(i, j, k):
                
                cnt += 1

print(cnt)

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

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




def hantei(x):
    count_1 = 0
    x_sort = sorted(x)
    number_1 = range(len(x))
    list_2 = [(x_sort[i],x_sort[j],x_sort[k]) for i in number_1 for j in number_1 for k in number_1 if i < j < k]
    for a in list_2:
        if a[0] + a[1] > a[2] and a[0] != a[1] and a[1] != a[2]:
            count_1 += 1
    return count_1

print(hantei(x))

Solution (Python):
import itertools
N=int(input())
L=list(map(int,input().split()))
ans=0
itr=list(itertools.combinations(L,3))
for i in itr:
    if i[0]!=i[1] and i[1]!=i[2] and i[2]!=i[0]:
        if i[0]+i[1]>i[2]and i[1]+i[2]>i[0]and i[2]+i[0]>i[1]:
            ans+=1
print(ans)

Solution (Python):
import itertools
N = input()
L = list(map(int, input().split()))
def triangle(a, b, c):
    
    if a+b > c and b+c > a and c+a > b:
        
        if a**2 == b**2 + c**2:
            return 0
        
        elif a**2 < b**2 + c**2:
            return 1
        
        elif a**2 > b**2 + c**2:
            return 2
    else:
        
        return 3
count = 0
for trio in itertools.combinations(L,3):
    if trio[0]==trio[1] == trio[2]:
        count += 0
    elif trio[0]==trio[1]:
        count += 0
    elif trio[0]==trio[2]:
        count += 0
    elif trio[2]==trio[1]:
        count += 0
    elif triangle(trio[0], trio[1], trio[2]) != 3:
        count += 1
    
print(count)

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

Solution (Python):

"""
Created on Sat Aug 15 21:15:44 2020

@author: naoki
"""

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

if len(L2) <= 2: 
    count =  0
else:
    for i in range(len(L2)-2):
        for j in range(i+1,len(L2)-1):
            for k in range(j+1,len(L2)):
                if (int(L2[i]) + int(L2[j]) > int(L2[k])) and (int(L2[i]) > int(L2[k]) - int(L2[j])) and int(L2[i]) != int(L2[j]) and int(L2[j]) != int(L2[k]):
                    count+=1
print(count)

Solution (Python):
import numpy as np

N = int(input())
ls = [int(s) for s in input().split()]

count = 0

for i in range(0, N-2):
  for j in range(i+1, N-1):
    l1 = ls[i]
    l2 = ls[j]
    if l2 == l1:
      continue
    for k in range(j+1, N):
      l3 = ls[k]
      if l3 in {l1, l2}:
        continue
      max_num = max((l1, l2, l3))
      if 2 * max_num < l1 + l2 + l3:
        count += 1

print(count)

Solution (Python):

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

if(len(L) < 3):
    print(0)
    exit(0)
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] 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]):
                    count += 1

print(count)

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

if N<=2:
    print(0)
else:
    answer=0
    for l in range(N-2):
        for m in range(l+1,N-1):
            for n in range(m+1,N):
                a=sorted([L[l],L[m],L[n]])
                if a[2]<a[0]+a[1]:
                    if a[0]!=a[1] and a[1]!=a[2] and a[2]!=a[0]:
                        answer+=1
    print(answer)

Solution (Python):
from sys import stdin,stdout
input = stdin.readline
def write(n,sep="\n"):
	stdout.write(str(n))
	stdout.write(sep)
def gil():
	return list(map(int, input().split()))
import itertools
N = int(input())
L = list(map(int, input().split()))
if N < 3:
    print(0)
    exit()
ans = 0
for bars in itertools.combinations(L, 3):
    if max(bars) >= sum(bars) - max(bars):
        continue
    if bars[0] == bars[1]:
        continue
    if bars[1] == bars[2]:
        continue
    if bars[0] == bars[2]:
        continue
    ans += 1
print(ans)