import copy
from sys import stdin


N = int(stdin.readline().rstrip())

L = [ int(x) for x in stdin.readline().rstrip().split()]

count = 0

for i in range(N):
    A = L.pop()
    Ln = copy.copy(L)
    for j in range(len(Ln)):
          B = Ln.pop()
          Lm = copy.copy(Ln)
          for k in Lm:
              C = k
              if ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ):
                    count+=1
              
          

print(count) 
                 import copy copy from sys import stdin N = int(stdin.readline().rstrip()) N int(stdin.readline().rstrip()) int stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x L = [ int(x) for x in stdin.readline().rstrip().split()] L [ int(x) for x in stdin.readline().rstrip().split()] count = 0 count 0 for i in range(N):
    A = L.pop()
    Ln = copy.copy(L)
    for j in range(len(Ln)):
          B = Ln.pop()
          Lm = copy.copy(Ln)
          for k in Lm:
              C = k
              if ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ):
                    count+=1
              
           i range(N) range N A = L.pop() A L.pop() L.pop L pop Ln = copy.copy(L) Ln copy.copy(L) copy.copy copy copy L for j in range(len(Ln)):
          B = Ln.pop()
          Lm = copy.copy(Ln)
          for k in Lm:
              C = k
              if ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ):
                    count+=1
              
           j range(len(Ln)) range len(Ln) len Ln B = Ln.pop() B Ln.pop() Ln.pop Ln pop Lm = copy.copy(Ln) Lm copy.copy(Ln) copy.copy copy copy Ln for k in Lm:
              C = k
              if ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ):
                    count+=1
              
           k Lm C = k C k if ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ):
                    count+=1
              
           ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ) ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) ( A != B ) and ( B != C ) and ( C != A ) ( A != B ) and ( B != C ) A != B A B B != C B C C != A C A A + B > C A + B A B C B + C > A B + C B C A C + A > B C + A C A B count+=1 count 1 print(count) print count count = 0 0 count Lm = copy.copy(Ln) copy.copy(Ln) Lm B = Ln.pop() Ln.pop() B N = int(stdin.readline().rstrip()) int(stdin.readline().rstrip()) N Ln = copy.copy(L) copy.copy(L) Ln count+=1 1 count L = [ int(x) for x in stdin.readline().rstrip().split()] [ int(x) for x in stdin.readline().rstrip().split()] L C = k k C A = L.pop() L.pop() A
import copy
from sys import stdin


N = int(stdin.readline().rstrip())

L = [ int(x) for x in stdin.readline().rstrip().split()]

count = 0

for i in range(N):
    A = L.pop()
    Ln = copy.copy(L)
    for j in range(len(Ln)):
          B = Ln.pop()
          Lm = copy.copy(Ln)
          for k in Lm:
              C = k
              if ( A != B ) and ( B != C ) and ( C != A ) and ( A + B > C ) and ( B + C > A ) and ( C + A > B ):
                    count+=1
              
          

print(count) 
                
