qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
ans = 0
lis = list(map(int,input().split()))
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i != j and j != k and i != k:
        if max(lis[i],lis[j],lis[k]) < lis[i]+lis[j]+lis[k]-max(lis[i],lis[j],lis[k]):
          ans += 1
print(ans)

Fixed code:
n = int(input())
ans = 0
lis = list(map(int,input().split()))
for i in range(n):
  for j in range(i,n):
    for k in range(j,n):
      if i != j and j != k and i != k:
        if lis[i] != lis[j] and lis[j] != lis[k] and lis[i] != lis[k]:
          if max(lis[i],lis[j],lis[k]) < lis[i]+lis[j]+lis[k]-max(lis[i],lis[j],lis[k]):
            ans += 1
print(ans)
Buggy code:
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(n):
    for k in range(n):
      if l[i]<l[j]+l[k] and l[j]<l[i]+l[k] and l[k]<l[i]+l[j]:
        cnt+= 1
print(cnt)

Fixed code:
n=int(input()) 
l = list(map(int,input().split())) 
if n<=2:
  print(0)
  exit()
  
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[j]-l[k])*(l[k]-l[i])==0:
        continue
      if l[i]<l[j]+l[k] and l[j]<l[i]+l[k] and l[k]<l[i]+l[j]:
        cnt+= 1
print(cnt)
Buggy code:
n = int(input())
l = sorted(set(map(int, input().split())))
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] + l[j] > l[k]:
        ans += 1
print(ans)

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

Fixed code:
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]:
                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)
Buggy code:
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
count=0
if n<3:
  print("0")
else:
  for i in range(n-2):
    for j in range(n-2-i):
      for k in range(n-2-i-j):
        if l[i]<l[j]+l[k] and l[i]!=l[j]!=l[k]:
          count+=1
print(count)


Fixed code:
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[i]<l[j]+l[k] and l[i]!=l[j]!=l[k]:
        count+=1
print(count)
Buggy code:
N = int(input())

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

cnt = 0

for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if a[i] == a[j] or a[j] == a[k] or a[i] == a[k]:
                continue
            if a[i] + a[j] >= a[k] or a[i] + a[k] >= a[j] or a[k] + a[j] >= a[i]:
                continue
            cnt += 1
print(cnt)

Fixed code:
N = int(input())

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

cnt = 0

for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if a[i] == a[j] or a[j] == a[k] or a[i] == a[k]:
                continue
            if a[i] + a[j] <= a[k] or a[i] + a[k] <= a[j] or a[k] + a[j] <= a[i]:
                continue
            cnt += 1

print(cnt)
Buggy code:
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 i + j > k:
          if j + k > i:
            if k + i > j:
              ans += 1
              
print(ans)

Fixed code:
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]>l[k] and l[i]+l[k]>l[j] and l[j]+l[k]>l[i] and l[i] != l[j] and l[j] != l[k] and l[i] != l[k]: 
        ans += 1
print(ans)
Buggy code:
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 <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < sum(l[i],l[j],l[k]) - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

Fixed code:
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 <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < l[i] +l[j] + l[k] - max(l[i],l[j],l[k]):
          ans+=1
print(ans)
Buggy code:
import math
def func():
    a=int(input())
    b = list(map(int,input().split()))
    f = [[[0 for i3 in range(100)] for i2 in range(100)] for i1 in range(100)]
    #print(a)
    #for i in range(a):
    #    print(b[i])
    z=0
    for i in range(a-2):
        ii=i
        p=b[ii]
        for j in range(a-1-ii):
            jj=ii+j+1
            q=b[jj]
            for k in range(a-1-jj):
                kk=jj+k+1
                r=b[kk]
                if p+q>r:
                    if p!=q and q!=r and r!=p:
                        z=z+1
    print(z)

func()

Fixed code:
import math
def func():
    a=int(input())
    b = list(map(int,input().split()))
    f = [[[0 for i3 in range(100)] for i2 in range(100)] for i1 in range(100)]
    #print(a)
    #for i in range(a):
    #    print(b[i])
    z=0
    for i in range(a-2):
        ii=i
        p=b[ii]
        for j in range(a-1-ii):
            jj=ii+j+1
            q=b[jj]
            for k in range(a-1-jj):
                kk=jj+k+1
                r=b[kk]
                if p+q>r and q+r>p and r+p>q:
                    if p!=q and q!=r and r!=p:
                        z=z+1
    print(z)

func()
Buggy code:
n = int(input())
l = list(map(int,input().split()))

if n <= 2:
  print(0)
  exit()

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

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

if n <= 2:
  print(0)
  exit()

cnt=0
for i in range(n-2):
  for j in range(i,n-1):
    for k in range(j,n):
      if ((l[i]!=l[j]) and (l[j]!=l[k]) and (l[k]!=l[i])) and (l[i]+l[j]>l[k]) and (l[k]+l[j]>l[i]) and (l[k]+l[i]>l[j]):
        cnt += 1
        
print(cnt)
Buggy code:
def A():
    s = input()
    if s == 'SSS': print(3)
    elif s=='RSS' or s=='SSR': print(2)
    elif s=='RRR': print(0)
    else: print(1)

def B():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                s = a[i] + a[j] + a[k]
                if s > 2 * max(a[i], a[j], a[k]): cnt += 1
    print(cnt)

def C():
    x, k, d = map(int, input().split())
    if abs(x) > k * d:
        print(abs(x) - k*d)
    else:
        tm = abs(x) // d
        x = abs(x) % d
        k -= tm
        if k % 2 == 0:
            print(x)
        else:
            print(d-x)
B()


Fixed code:
def A():
    s = input()
    if s == 'SSS': print(3)
    elif s=='RSS' or s=='SSR': print(2)
    elif s=='RRR': print(0)
    else: print(1)

def B():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            if a[i] == a[j]: continue
            for k in range(j+1, n):
                if a[i]==a[k] or a[j] == a[k]: continue
                s = a[i] + a[j] + a[k]
                if s > 2 * max(a[i], a[j], a[k]):
                    cnt += 1
    print(cnt)

def C():
    x, k, d = map(int, input().split())
    if abs(x) > k * d:
        print(abs(x) - k*d)
    else:
        tm = abs(x) // d
        x = abs(x) % d
        k -= tm
        if k % 2 == 0:
            print(x)
        else:
            print(d-x)
B()
Buggy code:
# 175 B
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
if N <3:
    print(0)

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

Fixed code:
# 175 B
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0

for i in range(0, len(L)):
    for j in range(i+1, len(L)):
        for k in range(j+1, len(L)):
            if L[i] != L[j] and L[j] != L[k] and (L[k] < L[i] + L[j]):
                ans += 1
print(ans)
Buggy code:
N=int(input())
L=list(map(int,input().split()))
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L[i]!=L[j]!=L[k]:
                sum_=L[i]+L[j]+L[k]
                if max(L[i],L[j],L[k])*2<sum_:
                    count+=1                

print(count)
                

Fixed code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L[i]!=L[j]!=L[k]:
                sum_=L[i]+L[j]+L[k]
                if max(L[i],L[j],L[k])*2<sum_:
                    count+=1                

print(count)
Buggy code:
import itertools
N = input()
L = input().split()
count = 0

for v_s in itertools.combinations(L, 3):
    v = [int (vv) for vv in v_s]
    if (v[0] != v[1]) and (v[1]!=v[2]): 
        if (v[0]+v[1]>v[2]) and (v[1]+v[2]>v[0]) and (v[2]+v[0]>v[1]):
            #print(v)
            count += 1

print(count)

Fixed code:
import itertools

N = input()
L = input().split()
count = 0

for v_s in itertools.combinations(L, 3):
    v = [int (vv) for vv in v_s]
    if (v[0] != v[1]) and (v[1] != v[2]) and (v[2] != v[0]): 
        if (v[0]+v[1]>v[2]) and (v[1]+v[2]>v[0]) and (v[2]+v[0]>v[1]):
            count += 1

print(count)
Buggy code:
n = int(input())
li = list(map(int, input().split()))

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

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

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

                if l[0] + l[1] > l[2]:
                    print(i+1, j+1, k+1)
                    print(l)
                    cnt += 1

    print(cnt)

Fixed code:
n = int(input())
li = list(map(int, input().split()))

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

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

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

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

    print(cnt)
Buggy code:
import collections

def main():
    n = int(input())
    l = list(map(int, input().split()))
    
    if n<3:
        print(0)
        return
    
    leng = n
    ans = 0
    for i in range(leng-2):
        a = l[i]
        for j in range(i+1, leng-1):
            b = l[j]
            if a==b:
                continue
            
            for j in range(j+1, leng):
                c = l[j]
                if c==a or c==b:
                    continue
                print(a,b,c)
                if a<b+c:
                    if b<c+a:
                        if c<a+b:
                            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Fixed code:
import collections

def main():
    n = int(input())
    l = list(map(int, input().split()))
    
    if n<3:
        print(0)
        return
    
    leng = n
    ans = 0
    for i in range(leng-2):
        a = l[i]
        for j in range(i+1, leng-1):
            b = l[j]
            if a==b:
                continue
            
            for j in range(j+1, leng):
                c = l[j]
                if c==a or c==b:
                    continue
                
                if a<b+c:
                    if b<c+a:
                        if c<a+b:
                            ans += 1
    print(ans)

if __name__ == "__main__":
    main()
Buggy code:
from itertools import combinations
n = int(input())
l = list(map(int,input().split()))
c = combinations(l,3)
ans=0
for (a,b,c) in c:
	if a+b>c and b+c>a and c+a>b and a!=b and b!=c and a!=c:
		+=1
print(ans)


Fixed code:
from itertools import combinations
n = int(input())
l = list(map(int,input().split()))
c = combinations(l,3)
ans=0
for (a,b,c) in c:
  if a+b>c and b+c>a and c+a>b and a!=b and b!=c and a!=c:
    ans+=1
print(ans)
Buggy code:
n=int(input())
l=[int(i) for i in input().split()]

l.sort()

def func(one,two,three):
  if len(set([one,two,three]))==3 and one+two>three:
    return True
  return False

ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three0l[k]
      if func(one,two,three):
        ans+=1
        
print(ans)
      

Fixed code:
n=int(input())
l=[int(i) for i in input().split()]
 
l.sort()
 
def func(one,two,three):
  if len({one,two,three})==3 and one+two>three:
    return True
  return False
 
ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three=l[k]
      if func(one,two,three):
        ans+=1
        
print(ans)
Buggy code:
N=int(input())
count=0

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

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


Fixed code:
N=int(input())
count=0

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

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 a[i]!=a[j]!=a[k]!=a[i]:
                    if a[k]<a[i]+a[j]:
                            count+=1
                        
print(count)
Buggy code:
n = int(input())
L=list(map(int,input().split()))
import itertools
p = list(itertools.combinations(L, 3))

cnt=0
for j in range(len(p)):
    m =p[j].index(max(p[j]))
    if len(list(set(p[j]))) ==3:
        if m==0:
            if abs(p[j][1]-p[j][2]) < p[j][m] < p[j][1]+p[j][2]:
                cnt+=1
        elif m==1:
            if abs(p[j][0]-p[j][2]) < p[j][m] < p[j][0]+p[j][2]:
                cnt+=1 
        elif m==2:
            if abs(p[j][0]-p[j][1]) < p[j][m] < p[j][0]+p[j][1]:
                cnt+=1

Fixed code:
n = int(input())
L=list(map(int,input().split()))
import itertools
p = list(itertools.combinations(L, 3))

cnt=0
for j in range(len(p)):
    m =p[j].index(max(p[j]))
    if len(list(set(p[j]))) ==3:
        if m==0:
            if abs(p[j][1]-p[j][2]) < p[j][m] < p[j][1]+p[j][2]:
                cnt+=1
        elif m==1:
            if abs(p[j][0]-p[j][2]) < p[j][m] < p[j][0]+p[j][2]:
                cnt+=1 
        elif m==2:
            if abs(p[j][0]-p[j][1]) < p[j][m] < p[j][0]+p[j][1]:
                cnt+=1
print(cnt)
Buggy code:
import sys
from itertools import combinations


def main():
    ll = read_ll()
    result = c(ll)
    print(result)

def c(ll):
    count = 0
    for i, j, k in combinations(ll, 3):
        if i != j and j != k and i != k:
            if i + j > k:
                count += 1
    return count

def read_ll():
    n = int(input())

    ll = input().split()
    ll = list(map(int, ll))
    ll.sort()
    return ll

if __name__ == 'main':
    main()


Fixed code:
import sys
from itertools import combinations


def main():
    ll = read_ll()
    result = c(ll)
    print(result)

def c(ll):
    count = 0
    for i, j, k in combinations(ll, 3):
        if i != j and j != k and i != k:
            if i + j > k:
                count += 1
    return count

def read_ll():
    n = int(input())

    ll = input().split()
    ll = list(map(int, ll))
    ll.sort()
    return ll

main()
Buggy code:
n = int(input())
l = list(map(int, input().split()))

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

l = sorted(l)

cnt = 0

for x in range(len(l)):
    for y in range(x+1, len(l)):
        su = l[x] + l[y]
        for z in range(y+1, len(l)):
            if l[x] == l[y] or l[x] == l[z] or l[y] == l[z]:
                break
            if su > l[z]:
                cnt += 1
            else:
                break

    continue

print(cnt)

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

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

l = sorted(l)

cnt = 0

for x in range(len(l)):
    for y in range(x+1, len(l)):
        su = l[x] + l[y]
        for z in range(y+1, len(l)):
            if l[x] == l[y] or l[x] == l[z] or l[y] == l[z]:
                continue
            if su > l[z]:
                cnt += 1
                #print(l[x], l[y], l[z])
            else:
                break

    continue

print(cnt)
Buggy code:
n=int(input())
arr=list(map(int,input().split()))
dummy=len(arr)
ans=0
if dummy>2:
  for i in range(dummy-2):
      for j in range(i+1,dummy-1):
          for k in range(j+1,dummy):
              if arr[i]!=arr[j] and arr[j]!=arr[k] and arr[k]!=arr[i]:
                  if arr[i]<arr[j]+arr[k] and arr[j]<arr[k]+arr[i] and arr[k]<arr[j]+arr[i]:
                      ans+=1
	print(ans)
else:
  print(0)

Fixed code:
n=int(input())
arr=list(map(int,input().split()))
dummy=len(arr)
ans=0
if dummy>2:
    for i in range(dummy-2):
        for j in range(i+1,dummy-1):
            for k in range(j+1,dummy):
                if arr[i]!=arr[j] and arr[j]!=arr[k] and arr[k]!=arr[i]:
                    if arr[i]<arr[j]+arr[k] and arr[j]<arr[k]+arr[i] and arr[k]<arr[j]+arr[i]:
                        ans+=1
    print(ans)
else:
    print(0)
Buggy code:
input_n = input()
n = int(input_n)

input_L = input()
L = str(input_L)

listL = L.split(' ')

max = 0
tmp1 = 0
tmp2 = 0
result = 0

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if int(listL[i]) > int(listL[j]):
                max = int(listL[i])
                tmp1 = int(listL[j])
            else :
                max = int(listL[j])
                tmp1 = int(listL[i])
            if int(listL[k]) > max:
                tmp2 = max
                max = int(listL[k])
            else :
                tmpw = int(listL[k])
            if max < (tmp1 + tmp2):
                result += 1

print(str(result))


Fixed code:
input_n = input()
n = int(input_n)

input_L = input()
L = str(input_L)

listL = L.split(' ')

max = 0
tmp1 = 0
tmp2 = 0
result = 0

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if int(listL[i]) != int(listL[j]) and int(listL[j]) != int(listL[k]) and int(listL[k]) != int(listL[i]):
                if int(listL[i]) > int(listL[j]):
                    max = int(listL[i])
                    tmp1 = int(listL[j])
                else :
                    max = int(listL[j])
                    tmp1 = int(listL[i])
                if int(listL[k]) > max:
                    tmp2 = max
                    max = int(listL[k])
                else :
                    tmp2 = int(listL[k])
                if max < (tmp1 + tmp2):
                    result += 1

print(str(result))
Buggy code:
a = int(input())
b = list(map(int,input().split()))
b.sort()
d = 0
 
if a <= 2:
  print("0")
else :
  for i in range(len(b)):
    for j in range(i+1,len(b)):
      for k in range(j+1,len(b)):
        if b[i]+b[j] > b[k]:
          d += 1
  print(str(d)) 

Fixed code:
a = int(input())
b = list(map(int,input().split()))
b.sort()
d = 0
 
if a <= 2:
  print("0")
else :
  for i in range(len(b)):
    for j in range(i+1,len(b)):
      for k in range(j+1,len(b)):
        if b[i]+b[j] > b[k] and b[i] != b[j] and b[j] != b[k]:
          d += 1
  print(str(d))
Buggy code:
N = int(input())
L = list(map(int,input().split()))

FF= []

count =0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+2,N):
            a = L[i]
            b = L[j]
            c = L[k]
            if a != b != c and a + b > c and b + c > a and c + a > b:
                    FF.append(str(a) + str(b) + str(c))
                    count += 1
if len(FF) == 0:
    print(0)
else:
    print(len(FF)+1)

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

FF= []

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 a != c and a + b > c and b + c > a and c + a > b:
                    FF.append(str(a) + str(b) + str(c))
print(len(FF))
Buggy code:
N = int(input())
count = 0
L = list(map(int, input().split()))
for i,li in enumerate(L[:-2]):
  for j,lj in enumerate(L[i+1:-1]):
    for k,lk in enumerate(L[i+j+1:]):
      if (li != lj) and (lj != lk):
#        la,lb,lc = sorted([li,lj,lk])
        if li + lj > lk and lj + lk > li and lk + li > lj:
#          print(i+1,i+j+1,i+j+k+1,li,lj,lk)
          count += 1
print(count)

Fixed code:
N = int(input())
count = 0
L = list(map(int, input().split()))
for i,li in enumerate(L[:-2]):
  for j,lj in enumerate(L[i+1:-1]):
    for k,lk in enumerate(L[i+j+1:]):
      if (li != lj) and (lj != lk) and (li != lk):
#        la,lb,lc = sorted([li,lj,lk])
        if li + lj > lk and lj + lk > li and lk + li > lj:
#          print(i+1,i+j+1,i+j+k+1,li,lj,lk)
          count += 1
print(count)
Buggy code:
import itertools
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
count = 0
for i in itertools.combinations(arr, 3):
  if i[0]+i[1] > i[3] and i[0]+i[3] > i[1] and i[3]+i[1] > i[0]:
    count += 1
print(count)
    
  


Fixed code:
import itertools

n = int(input())
arr = list(map(int, input().split()))
arr.sort()
count = 0
for i in itertools.combinations(arr, 3):
    if i[0] + i[1] > i[2] and i[0] + i[2] > i[1] and i[2] + i[1] > i[0] and i[0] != i[1] != i[2]:
        count += 1
print(count)
Buggy code:
N = int(input())
A = list(map(int, input().split()))
count = 0
def make_sankaku(san):
    if san[0] == san[1] or san[1] == san[2] or san[2] == san[0]:
        return False
    else:
        san.sort()
        if san[2] - san[0] >= san[1]:
            return False
    return True
All_a = []
if len(A) <3:
    count = 0
else:
    for i in range(len(A)):
        for k in range(i+1, len(A)):
            for l in range(k + 1 ,len(A)):
                if make_sankaku([A[i], A[k], A[l]]):
                    print(i,k,l)
                    if [A[i], A[k], A[l]] not in All_a:
                        print([A[i], A[k], A[l]])
                        count += 1
print(count)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
count = 0
def make_sankaku(san):
    if san[0] == san[1] or san[1] == san[2] or san[2] == san[0]:
        return False
    else:
        san.sort()
        if san[2] - san[0] >= san[1]:
            return False
    return True
All_a = []
if len(A) <3:
    count = 0
else:
    for i in range(len(A)):
        for k in range(i+1, len(A)):
            for l in range(k + 1 ,len(A)):
                if make_sankaku([A[i], A[k], A[l]]):
                    if [A[i], A[k], A[l]] not in All_a:
                        count += 1
print(count)