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
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    L=list(mi())

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

    print(ans)




if __name__ == "__main__":
    main()

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
l = nl()

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]):
          ll = sorted([l[i],l[k],l[j]])
          if ll[0]+ll[1]>ll[2]:
            cnt+=1
print(cnt)

Solution (Python):
import itertools

N = int(input())
L_list = [int(e) for e in input().split()]

ans = 0

for Li,Lj,Lk in itertools.combinations(L_list, 3):
    if Li != Lj != Lk != Li:
        comb_L = [Li,Lj,Lk]
        comb_L.sort(reverse=False)
        longest = comb_L.pop(-1)
        if longest < sum(comb_L):
            ans += 1
            
print(ans)

Solution (Python):
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()



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

Out.int(ans)




if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

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

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

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):
            for k in range(j):
                lv = [L[i], L[j], L[k]]
                lv.sort()
                
                if len(set(lv)) == 3 and lv[2] < lv[1] + lv[0]:
                    ans += 1
    return ans



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

Solution (Python):
def main():
    n = int(input())
    l = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i+1,n-1):
            for k in range(j+1,n):
                if l[i]!=l[j] and l[j]!=l[k]:
                    if l[k]<l[i]+l[j]:
                        ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
arr = [int(j) for j in input().split()]
ans = 0
arr.sort()
for i in range(len(arr)):
	for j in range(i+1, len(arr)):
		for k in range(j+1, len(arr)):
			if arr[i] + arr[j] > arr[k] and arr[i] != arr[j] and arr[j] != arr[k] and arr[k] != arr[i]:
				ans += 1


print(ans)

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

print(ans)

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


l.sort()

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

print(cnt)

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

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

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

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

Solution (Python):


import sys
input=sys.stdin.readline

n=int(input())
arr=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):
            tmp=[arr[i],arr[j],arr[k]]
            tmp=sorted(tmp)
            s=set(tmp)
            if len(s)==3 and tmp[0]+tmp[1]>tmp[2]:
                ans+=1
print(ans)

Solution (Python):
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):
        if l[i] == l[j]:
            continue
        for k in range(j + 1, n):
            if l[i] == l[k] or l[j] == l[k]:
                continue
            if l[i] + l[j] > l[k]:
                count += 1
print(count)

Solution (Python):
from itertools import combinations
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in combinations(l, 3):
    i = list(i)
    i.sort()
    if i[0]==i[1] or i[1]==i[2]:
        continue
    if i[0]+i[1]>i[2]:
        ans += 1
print(ans)

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
L = sorted(readInts())
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[j] == L[k]:
                continue
            if abs(L[i]-L[j]) < L[k] < L[i] + L[j]:
                ans += 1
print(ans)

Solution (Python):
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

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

Solution (Python):
def main():
    N = int(input())
    L = [int(_x) for _x in input().split()]
    length = len(L)
    LL = list(sorted(L))
    cnt = 0
    for i in range(0, length):
        for j in range(i+1, length):
            for k in range(j+1, length):
                if LL[i] + LL[j] > LL[k] and LL[i] != LL[j] and LL[i] != LL[k] and LL[j] != LL[k]:
                    cnt += 1
    print(cnt)


main()

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

if N < 2:
    print(0)
    exit()

cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        if L[i] == L[j]:
            continue

        for k in range(j + 1, N):
            if (L[i] != L[k]) and (L[j] != L[k]) and (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=[*map(int,input().split())]
c=0
for i in l:
  for j in l:
    for k in l:
      if i!=j!=k!=i and j+k>i and k+i>j and i+j>k:
        c+=1
print(c//6)

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

if N<=2:
    print(0)
    exit()
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 and b!=c and c!=a:
                if a+b>c and b+c>a and c+a>b:
                    count+=1

print(count)

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

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

Solution (Python):
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

t=1

for _ in range(t):
    n=ii()
    ans=0
    a=ll()
    
    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[i]+a[k])>a[j] and (a[j]+a[k])>a[i] and a[i]!=a[j] and a[j]!=a[k] and a[i]!=a[k]) :
                    ans+=1
    print(ans)

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

ans = 0
for a in range(N):
    la = L[a]
    for b in range(a+1,N):
        lb = L[b]
        if la==lb: continue
        for c in range(b+1,N):
            lc = L[c]
            if la==lc or lb==lc: continue
            if (lc < lb + la) and (lb < la + lc) and (la < lb + lc):
                ans += 1

print(ans)

Solution (Python):

import sys
def main(N, L):
    L.sort()
    ans = 0
    for i in range(N):
        for j in range(i + 1, N):
            if L[i] == L[j]: continue
            for k in range(j + 1, N):
                if L[i] == L[k] or L[j] == L[k]: continue
                if L[i] + L[j] > L[k]:
                    ans += 1
    print(ans)

if __name__ == '__main__':
    input = sys.stdin.readline
    N = int(input())
    *L, = map(int, input().split())
    main(N, L)

Solution (Python):
import sys
input = sys.stdin.readline
from itertools import combinations
N = int(input())
L = list(map(int,input().split()))

ans = 0
for a,b,c in combinations(L,3):
    if c<a+b and a<b+c and b<a+c:
        if a != b and b != c and c != a:
            ans += 1

print(ans)

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

Solution (Python):
import sys, math
from functools import lru_cache
from collections import defaultdict
sys.setrecursionlimit(500000)
MOD = 10**9+7

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

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    L = list(mi())
    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] \
                    and abs(L[j]-L[k]) < L[i] < L[j]+L[k]:
                    cnt += 1

    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
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):
                a, b, c = l[i], l[j], l[k]
                if a == b or b == c or c == a:
                    continue
                if a+b>c and b+c>a and c+a>b:
                    ans += 1
                
    
    print(ans)
    
if __name__ == "__main__":
    main()

Solution (Python):
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):
            T = [L[i],L[j],L[k]]
            T.sort()
            s,m,l = T
            if s != m and m != l and l != s:
                if l < s+m:
                    ans += 1
print(ans)

Solution (Python):
n = int(input())
ls = list(map(int, input().split()))
ls.sort()
ans = 0 
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            li = ls[i]
            lj = ls[j]
            lk = ls[k]
            if (li-lj)*(lj-lk)*(lk-li) == 0:
                continue
            if li + lj > lk and lj + lk > li and lk+li > lj:
                ans += 1
print(ans)

Solution (Python):
from itertools import*
n, *l = map(int, open(0).read().split())
cnt = 0
for a, b, c in combinations(l, 3):
    if a != b != c != a and a + b > c and b + c > a and c + a > b:
        cnt += 1
print(cnt)

Solution (Python):
N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for l1 in L:
    for l2 in L:
        for l3 in L:
            ans += (l1 !=l2) and (l2 != l3) and (l3 != l1) and (2*max(l1, l2, l3) < l1+l2+l3)
print(ans//6)

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

count = 0
for i in range(len(L)-2):
    l1 = L[i]
    for j in range(i+1,len(L)-1):
        l2 = L[j]
        for k in range(j+1,len(L)):
            l3 = L[k]
            if (l1-l2)*(l2-l3)*(l3-l1) == 0:
                continue
            l_max = max(l1,l2,l3)
            l_left = l1+l2+l3-l_max
            if l_left > l_max:
                count += 1
print(count)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  

N = I()
L = LI()

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

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

Solution (Python):
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
import copy


MOD = 10 ** 9 + 7



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

print(count)

Solution (Python):
from itertools import combinations
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in combinations(l, 3):
    
    a, b, c = i
    
    if (a != b and b != c and c != a) and \
        (a+b>c and b+c > a and c+a>b):
        ans += 1

print(ans)

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

Ls.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 = Ls[i], Ls[j], Ls[k]
            if A == B or B == C or C == A:
                continue
            if A + B > C:
                ans += 1

print(ans)

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

cnt = 0
for i in range(n):
   for j in range(i+1, n):
      if x[i] == x[j]:
         continue
      for k in range(j+1, n):
         if x[i] != x[k] and x[j] != x[k]:
            y = [x[i], x[j], x[k]]
            y.sort()
            if y[0] + y[1] > y[2]:
               cnt += 1
print(cnt)

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

INF = float("inf")


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

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

c = 0
for i, Li in enumerate(L):
    for j, Lj in enumerate(L):
        for k, Lk in enumerate(L):
            if i < j < k and len(set([Li, Lj, Lk])) == 3:
                max_e, *else_e = sorted([Li, Lj, Lk], reverse=True)
                if sum(else_e) > max_e:
                    c += 1

print(c)

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
            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)

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(i + 1, n):
        b = L[j]
        if a == b:
            continue
        for k in range(j + 1, n):
            c = L[k]
            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 itertools

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

x = 0
for ls in itertools.combinations(l, 3):
    if len(set(ls)) != 3:
        continue
    if ls[0] + ls[1] > ls[2] and ls[1] + ls[2] > ls[0] and ls[0] + ls[2] > ls[1]:
        x += 1
print(x)

Solution (Python):
import itertools

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

L = list(itertools.combinations(A,3))
ans = 0
for x in L:
  x = list(x)
  x.sort()
  if x[0] == x[1] or x[1] == x[2] or x[2] == x[0]:
    continue
  if x[0]+x[1] > x[2]:
    
    ans +=1
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')


from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations




def solve():
    N = II()
    L = LI()

    cnt = 0
    for (i, j, k) in comb(range(N), r=3):
        if i == j or j == k or k == i:
            continue
        tmp = sorted([L[i], L[j], L[k]])
        if tmp[0] == tmp[1] or tmp[1] == tmp[2] or tmp[2] == tmp[0]:
            continue
        if tmp[0] + tmp[1] > tmp[2]:
            
            cnt = cnt + 1
    print(cnt)



if __name__ == '__main__':
    solve()

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

Solution (Python):
n = int(input())
ans = 0
l_list = [int(i) for i in input().split()]
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l_list[i] + l_list[j] > l_list[k] > abs(l_list[i] - l_list[j]):
                if (l_list[i] != l_list[j]) & (l_list[j] != l_list[k]) & (l_list[k] != l_list[i]):
                    ans += 1
print(ans)

Solution (Python):
n=int(input())
l=sorted([int(i) for i in input().split()])
if(n<3):
  print(0)
else:
  c=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 len(set([l[i],l[j],l[k]]))==3):
          c+=1
  print(c)

Solution (Python):
n=int(input())
A=[int(i) for i in input().split()]

ans=0
for i in range(n-2):
    for q in range(i,n-1):
        for r in range(q,n):
            ck=[A[i],A[q],A[r]]
            ck.sort()
            if len(set(ck))==3 and ck[0]+ck[1]>ck[2]:
                ans+=1
print(ans)

Solution (Python):
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]
            
            if a+b > c and a+c > b and  b+c > a and a != b and b != c and c != a:
                ans += 1
print(ans)

Solution (Python):
def main():
    n = int(input())
    ans = 0
    arr = list(map(int, input().split()))
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if arr[i] < arr[j] + arr[k] and arr[j] < arr[i] + arr[k] and arr[k] < arr[i] + arr[j] and arr[i] != arr[j] and arr[j] != arr[k] and arr[k] != arr[i]:
                    ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

n = n_in()
L = l_in()


from itertools import combinations

print(sum(i + j > k and j + k > i and k + i > j and i != j and j != k and k != i for i,j,k in combinations(L, 3)))

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

Solution (Python):
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):
            tmp = []
            tmp.append(ls[i])
            tmp.append(ls[j])
            tmp.append(ls[k])
            tmp.sort()
            if tmp[0] + tmp[1] > tmp[2]:
                if tmp[0] != tmp[1] and tmp[1] != tmp[2] and tmp[2] != tmp[0]:
                    count += 1

print(count)

Solution (Python):


import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,*a = map(int,read().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] and a[j]!=a[k] and a[k]!=a[i] and a[i]+a[j]+a[k] > 2*max(a[i],a[j],a[k]):
                ans += 1
                

print(ans)

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

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

print(count)

Solution (Python):
def resolve():
    import itertools
    n = int(input())
    l = list(map(int, input().split()))
    l = sorted(l)
    ans = 0
    for a, b, c in itertools.combinations(range(1, n + 1), 3):
        x = l[a-1]
        y = l[b-1]
        z = l[c-1]
        if x != y and y != z and z != x and z < x + y:
            ans += 1
    print(ans)
resolve()

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i):
        for k in range(j):
            ans += abs(l[i] - l[j]) < l[k] < abs(l[i] + l[j]) and len({l[i], l[j], l[k]}) == 3
print(ans)

Solution (Python):
n = int(input())
l = [int(i) for i in 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
            if l[i] >= l[j] + l[k]: continue
            if l[j] >= l[i] + l[k]: continue
            if l[k] >= l[i] + l[j]: continue
            ans += 1
print(ans)

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

Solution (Python):
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):
      s = set([a[i],a[j],a[k]])
      if len(s) == 3:
        if (a[i]+a[j] > a[k]) and (a[i]+a[k] > a[j]) and (a[j]+a[k] > a[i]):
          ans += 1
print(ans)

Solution (Python):
def main():
    N = int(input())
    L = 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 (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)



if __name__ == "__main__":
    main()

Solution (Python):
from itertools import combinations

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

combi = combinations(l, 3)

ans = 0
for a, b, c in combi:
    if a != b and b != c and c != a:
        if a + b > c and b + c > a and c + a > b:
            ans += 1

print(ans)

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

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

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

print(ans)