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):
def b(x, y, z):
    flag = False
    if (z < x + y) and (y < z + x) and (x < z + y):
        if (x != y) and (y != z) and (x != z):
            flag = True
    return flag
cnt = 0
N = int(input())
L = list(map(int, input().split()))
for i in range(N):
    x = L[i]
    for j in range(i + 1, N):
        y = L[j]
        for k in range(j + 1, N):
            z = L[k]
            if b(x, y, z):
                cnt += 1
print(cnt)

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

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

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


c = it.combinations(L, 3)
c_list = list(c)

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

print(cnt)

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[i] != l[k]) and (l[j] != l[k]):
      	if (l[i] < (l[j] + l[k])) and (l[j] < (l[i] + l[k])) and (l[k] < (l[i] + l[j])):
        	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 not (L[i] == L[j] or L[j] == L[k] or L[k] == L[i]):
                tmp = sorted([L[i], L[j], L[k]], reverse=True)
                if tmp[0] < tmp[1]+tmp[2]:
                    ans+=1
                    
                    
print(ans)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ct=0
b=0
for i in range(0,n-2):
  p=a[i]
  for j in range(i+1,n-1):
    q=a[j]
    for k in range(j+1,n):
      r=a[k]
      if p!=q and q!=r and r!=p and 2*max(p,q,r)<p+q+r:
        ct+=1
print(ct)

Solution (Python):
import itertools
N = int(input())
a = list(map(int,input().split()))
count=0
for a in list(itertools.combinations(a,3)):
  if a[0]!=a[1] and a[1]!=a[2] and a[0]!=a[2]:
    if a[1]+a[2]>a[0] and a[0]+a[2]>a[1] and a[0]+a[1]>a[2]:
      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] 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
                else:
                    pass
print(ans)

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

    ans = 0
    for i in range(N):
        for j in range(i, N):
            if L[i] == L[j]:
                continue
            for k in range(j, N):
                if L[k] == L[i] or L[k] == L[j]:
                    continue
                s = sorted([L[i], L[j], L[k]])
                if s[0] + s[1] > s[2]:
                    ans += 1
    print(ans)

if __name__ == "__main__":
    resolve()

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
counter = 0
for i in range(0,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] or L[i] == L[k]:
                continue
            else:
                longest = max(L[i],L[j],L[k])
                if 2*longest < L[i]+L[j]+L[k]:
                    counter += 1
print(counter)

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

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

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

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

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

if len(N_list) <= 2:
  print(0)
  
else:
  cnt = 0
  for i in range(len(N_list)-2):
    for j in range(i+1,len(N_list)-1):
      for k in range(j+1,len(N_list)):
        if (abs(N_list[i]-N_list[j])<N_list[k]<N_list[i]+N_list[j]) and (abs(N_list[j]-N_list[k])<N_list[i]<N_list[j]+N_list[k]) and (abs(N_list[i]-N_list[k])<N_list[j]<N_list[i]+N_list[k]) and (N_list[i]!=N_list[j]) and (N_list[j]!=N_list[k]) and (N_list[i]!=N_list[k]):
          cnt+=1
          
  print(cnt)

Solution (Python):
from itertools import combinations
n = int(input())
L = list(map(int, input().split()))

ans = 0
for subset in combinations(L, 3):
    subset = sorted(subset)
    if len(set(subset)) != 3:
        continue
    a, b, c = subset
    if 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(len(l)):
    for j in range(i, len(l)):
        for k in range(j, len(l)):
            if l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
                if l[i] + l[j] > l[k]:
                    ans += 1

print(ans)

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
            
            edges = [L[i],L[j],L[k]]
            edges = sorted(edges)
            
            if edges[2] >= edges[1] + edges[0]:
                continue
            ans += 1
print(ans)

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

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

Solution (Python):
def linked_merge_sort(l): 
    if len(l) == 1:
        return
    q, r = divmod(len(l), 2)
    left = [l.pop() for _ in range(q)]
    right = [l.pop() for _ in range(q + r)]
    
    linked_merge_sort(left)
    linked_merge_sort(right)
    
    left.reverse()
    right.reverse()
    while left and right:
        if left[-1] <= right[-1]:
            l.append(left.pop())
        else:
            l.append(right.pop())
    while left:
        l.append(left.pop())
    while right:
        l.append(right.pop())
    return

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

linked_merge_sort(l)

ans=0

for x in l:
    i=0
    while l[i]<x:
        j=i+1
        while l[j]<x:
            if l[i]+l[j]>x and l[i]!=l[j]:
                ans+=1
            j+=1
        i+=1

print(ans)

Solution (Python):
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007

inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file=1




def solve():
    
    

    

        n= ii()
        a = li()
        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[i]!=a[k]:
                        s = a[i]+a[j]+a[k]
                        mx = max(a[i],max(a[j],a[k]))
                        if s > 2*mx:
                            ans+=1

        print(ans)













        
if __name__ =="__main__":

    if(file):

        if path.exists('input.txt'):
            sys.stdin=open('input.txt', 'r')
            sys.stdout=open('output.txt','w')
        else:
            input=sys.stdin.readline
    solve()

Solution (Python):
import itertools
n=int(input())
data=list(map(int,input().split()))
count=0
if len(data) < 3:
    print(0)
else:
    for d in itertools.combinations(data,3):
        
        triple=list(d)
        if (triple[0]+triple[1] > triple[2]) and (triple[1]+triple[2] > triple[0]) and (triple[2]+triple[0] > triple[1]):
            if triple[0] != triple[1] and triple[1] != triple[2] and triple[2] != triple[0]:
                count += 1
        
        else:
            pass
    print(count)

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

cnt = 0
for a, b, c in itertools.combinations(L, 3):
    if a + b > c and b + c > a and a + c > b and a != b and b != c and c != a:
        cnt += 1

print(cnt)

Solution (Python):
import itertools
n=int(input())
l=sorted([int(i) for i in input().split()])
ans=0

for i in range(n-2):
    A=list(itertools.combinations(l[:i+2],2))
    for a in A:
        if a[0]!=a[1]!=l[i+2] and sum(a)>l[i+2] :
            
            ans+=1
print(ans)

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

if n > 2:
    ls.sort()
    for i in range(n - 2):
        for j in range(i + 1,n - 1):
            for k in range(j + 1,n):
                if ls[i] < ls[j] and ls[j] < ls[k] and ls[k] < ls[i] + ls[j]:
                    ans += 1

print(ans)

Solution (Python):
N = int(input())
L = [int(a) for a in input().split()]
cnt = 0
for i in range(0,N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:
                if (abs(L[i]-L[j])<L[k] and L[k]<L[i]+L[j]) or\
                (abs(L[j]-L[k])<L[i] and L[i]<L[j]+L[k]) or\
                (abs(L[k]-L[i])<L[j] and L[j]<L[k]+L[i]):
                    cnt += 1
print(cnt)

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

total = 0
for i in range(n-2):
    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[j]>a[k]:
                total +=1
print(total)

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

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

print(count)

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

counter = 0

import itertools
for v in itertools.combinations(l, 3):
  t = sorted(v, reverse=False)
  if (t[0]!=t[1])&(t[0]!=t[2])&(t[1]!=t[2])&((t[0]+t[1]) > t[2]):
    counter+=1

print(counter)

Solution (Python):
from itertools import combinations
N = int(input())
L = list(map(int, input().split()))
ans = 0
for l in combinations(L, 3):
    a = l[0]
    b = l[1]
    c = l[2]
    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)

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

print(ans)

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
from bisect import bisect_left


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

def bindex(a,x):
    i = bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return i
    return None

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    N = intinput()
    indatas = list(mulinputs())

    ans = set([])
    for i in range(0,N):
        for j in range(i+1,N):
            for k in range(j+1,N):
                l0 = indatas[i]
                l1 = indatas[j]
                l2 = indatas[k]
                if l0 == l1:
                    continue
                if l0 == l2:
                    continue
                if l1 == l2:
                    continue
                if l0 < l1 + l2 and l1 < l0 + l2 and l2 < l0 + l1:
                    ans.add(tuple(sorted([i,j,k])))

    
    print(len(ans))

Solution (Python):
N = int(input())
L = sorted(list(map(int, input().split())))
ans = [1 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]]
print(len(ans))

Solution (Python):
import sys
import numpy as np

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


n = int(input())
l = np.array(readline().split(), dtype=np.int64)
l, c = np.unique(l, return_counts=True)
x = len(l)
ans = 0
for i in range(x-2):
    for j in range(i+1, x-1):
        for k in range(j+1, x):
            if l[i] + l[j] > l[k] :
                ans += c[i] * c[j] * c[k]
print(ans)

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

for i in range(n):
    if l[i] not in num_map:
        num_map[l[i]] = 1
    else:
        num_map[l[i]] += 1

num_list = sorted(list(num_map.keys()))
m = len(num_list)
res = 0
for i in range(m - 2):
    for j in range(i + 1, m - 1):
        for k in range(j + 1, m):
            if num_list[i] + num_list[j] > num_list[k]:
                res += num_map[num_list[i]] * num_map[num_list[j]] * num_map[num_list[k]]
print(res)

Solution (Python):
import sys
from itertools import combinations


def resolve(in_):
    N = int(next(in_))
    L = list(map(int, next(in_).split()))
    L.sort()

    ans = 0
    for i, j, k in combinations(L, 3):
        if not (i < j < k):
            continue
        if i + j > k and j + k > i and k + i > j:
            ans += 1
    return ans

def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

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

print(cnt)

Solution (Python):


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

L.sort(reverse=True)

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

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

L.sort()

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

print(c)

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

count = 0

for i in range(0,n):
  for j in range(i+1, n):
    for k in range(j+1, n):
      if an[i] == an[j] or an[j] == an[k] or an[i] == an[k]:
        continue
        
      sn = [an[i],an[j],an[k]]
      sn.sort()
      if sn[0] + sn[1] > sn[2]:
        count += 1
print(count)

Solution (Python):
n=int(input(''))
l=list(map(int,input('').split(' ')))
p=0
for a in range(0,n):
    for b in range(a,n):
        s0=l[a]+l[b]
        for c in range(b,n):
            s1=l[a]+l[c]
            s2=l[b]+l[c]

            if l[a]!=l[b] and l[b]!=l[c] and l[c]!=l[a]:
                if s1>l[b] and s2>l[a] and s0>l[c]:
                    p+=1

print(p)

Solution (Python):


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

ans = 0

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

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

if N <= 3:
    print(0)
    exit()

ans = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            ans += 1
            if L[i] == L[j]:
                ans -= 1
            elif L[j] == L[k]:
                ans -= 1
            elif L[i] + L[j] <= L[k]:
                ans -= 1

print(ans)

Solution (Python):
from itertools import combinations

N = int(input())
data = list(map(int, input().split()))
data.sort()
c = 0
for tri in combinations(data, 3):
  if tri[0] < tri[1] < tri[2] and tri[0] + tri[1] > tri[2] and tri[0] + tri[2] > tri[1] and tri[2] + tri[1] > tri[0]:
    c += 1
print(c)

Solution (Python):






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

    i1 = 0
    i2 = 1
    i3 = 2

    c = 0
    while i1 < N-2:
        if L[i1] != L[i2] and L[i2] != L[i3] and L[i3] != L[i1] and \
            L[i1]+L[i2] > L[i3] and \
            L[i2]+L[i3] > L[i1] and \
        L[i3]+L[i1] > L[i2]:
            c += 1
        if i3 < N-1:
            i3 += 1
        elif i2 < N-2:
            i2 += 1
            i3 = i2 + 1
        else:
            i1 += 1
            i2 = i1 + 1
            i3 = i2 + 1

    print(c)

main()

Solution (Python):
import itertools

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

for group in itertools.combinations(L, 3):
    if group[0] != group[1] and \
        group[1] != group[2] and \
        group[2] != group[0] and \
        group[0] + group[1] > group[2] and \
        group[1] + group[2] > group[0] and \
        group[2] + group[0] > group[1]:
            cnt += 1

print(cnt)

Solution (Python):
import collections
S = int(input().rstrip())
L = list(map(int,input().rstrip().split()))
c = collections.Counter(sorted(L))
key = list(c.keys())
ans = 0
num = len(c)
for i in range(num-2):
    for j in range(i+1,num-1):
        for k in range(j+1,num):
            if key[i]+key[j]>key[k]:
                ans += c[key[i]]*c[key[j]]*c[key[k]]
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,n):
        for k in range(j,n):
            if l[i] != l[j] and l[i] != l[k] and l[j] != l[k]:
                if abs(l[i]-l[j]) < l[k] < l[i] + l[j]:
                    ans += 1
print(ans)

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

ans = ans // 6
print(ans)

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

from itertools import combinations
c = combinations(L, 3)
count = 0
for cs in c:
    if len(set(cs)) < 3:
        continue
    cs = sorted(cs)

    if cs[0] + cs[1] <= cs[2]:
        continue

    count += 1
print(count)

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[j] == L[k]:
                continue
            elif L[k] == L[i]:
                continue
            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):
import itertools

n = int(input())
ln = list(map(int, input().split()))
num = [i for i in range(n)]
combi_list = []
for i in itertools.combinations(num, 3):
    combi_list.append(i)
Ans = 0
for i in range(len(combi_list)):
    hen = sorted([ln[combi_list[i][0]],ln[combi_list[i][1]],ln[combi_list[i][2]]])
    if hen[2] < hen[0]+hen[1] and (hen[0]!=hen[1] and hen[1]!=hen[2] and hen[2] != hen[0]):
        Ans +=1
print(Ans)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
tr = set()
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
            a = l[i]
            b = l[j]
            c = l[k]
            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()))

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[k] in (l[i], l[j]):
                continue

            c = sorted([l[i], l[j], l[k]])
            if c[0] + c[1] > c[2]:
                count += 1

print(count)

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

Ls.sort()

result = 0
for i in range(len(Ls)-2):
    for j in range(i+1, len(Ls)-1):
        if Ls[i] == Ls[j]:
            continue
        for k in range(j+1, len(Ls)):
            if Ls[j] == Ls[k]:
                continue
            if Ls[i] + Ls[j] > Ls[k]:
                result += 1


print(result)

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

list1 = list(itertools.combinations(L, 3))
count=0
for i in list1:
    if i[0] != i[1] and i[1] != i[2] and i[2] != i[0]:
        if i[0] + i[1] <= i[2]:
            continue
        
        if i[0] + i[2] <= i[1]:
            continue
        
        if i[2] + i[1] <= i[0]:
            continue
    
        count+=1
    else:
        continue
print(count)

Solution (Python):

n = int(input())
l = list(map(int, input().split()))
l_set = set(l)
import itertools
if len(l_set) < 3:
    print("0")
    
else:
    
    ans = 0
    for b in itertools.combinations(l, 3):
        if (b[0] != b[1]) and (b[1] != b[2]) and  (b[2] != b[0]):
            if (b[0] + b[1] > b[2]) and (b[1]+b[2] > b[0]) and (b[2] + b[0] > b[1]):
                ans += 1
    print(ans)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
c = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            s = []
            s.append(l[i])
            s.append(l[j])
            s.append(l[k])
            s.sort()
            if s[0]+s[1] > s[2]:
                if len(set(s)) == 3:
                    c += 1

print(c)

Solution (Python):
n, *l = map(int, open(0).read().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] or l[j]+l[k]<=l[i] or l[k]+l[i]<=l[j]): continue
            ans += 1
print(ans)

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

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

ans = 0
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 l[j] + l[k] > l[i] and l[k] + l[i] > l[j]:
                c += 1
                
                if l[i] == l[j] or l[j] == l[k] or l[k] == l[i]:
                    c += 1
                else:
                    
                    ans += 1
                    c += 1

print(ans)

Solution (Python):
N = int(input())
List = list(map(int, input().split()))
res = 0
if N >=3:
  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] or List[i]==List[k] or List[k]==List[j]:
          pass
        else:
          if List[i]+List[j] > List[k] and List[j]+List[k] > List[i] and List[k]+List[i] > List[j]:
            res += 1
print(res)

Solution (Python):

def inputlist(): return [int(j) for j in input().split()]

N = int(input())
L = inputlist()
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):
import numpy as np
n = int(input())
l = np.array(list(map(int,input().split())))

counter = 0
lenl = len(l)
for i in range(lenl):
  for j in range(i+1,lenl):
    for k in range(j+1,lenl):
      if l[i] == l[j] or l[j] == l[k] or l[i] == l[k]:
        continue
      if max([l[i],l[k],l[j]]) >= l[i]+l[k]+l[j]-max([l[i],l[k],l[j]]):
        continue
      else:
        counter += 1
print(counter)

Solution (Python):
import math

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








l_list = sorted(l_list)



ans = 0

for a in range(len(l_list)):
    
    for b in range(a + 1, len(l_list)):

        for c in range(b + 1,len(l_list)):

           if l_list[a] != l_list[b] and l_list[b] != l_list[c] and l_list[c] != l_list[a] and abs(l_list[b] - l_list[c]) < l_list[a] < l_list[b] + l_list[c] :
               ans += 1

print(ans)