require 'pp'

###################

# inputType = :singleLine
inputType = :l2Lines
# inputType = :nLines
  
def main(query)
  ret = []
  n, ls = query
  
  ls = tois(ls.chomp.split(' '))

  count = 0
  r = 0.upto(ls.size-1).to_a
  r.combination(3).uniq.each { | a,b,c |
    aa,bb,cc = [ls[a],ls[b],ls[c]].sort { | x,y | y <=> x}
    #    p [[a,b,c], [aa,bb,cc]]
    #    p [a,b,c]
    if (aa < bb+cc && aa != bb && aa != cc && bb != cc) then
      #      p [a,b,c]
      count = count + 1
    end
  }

  ret.push count.to_s
  
  return ret
end

###################

TEST=false

def tois(l)
  l.map { | x | x.to_i}
end

def ppp(msg, val)
  if (TEST) then
    print msg
    pp val
  end
end

target = nil
if (ARGV.size == 0) then
  f = STDIN
end
if (ARGV.size > 0) then
  f = open(ARGV[0])
end
if (ARGV.size > 1) then
  target = ARGV[1].to_i
end

t = 1
ng = []
while true
  if (inputType == :singleLine) then
    a = f.gets
    if ! a then
      exit
    end
    a.chomp!
    query = a
  elsif (inputType == :l2Lines) then
    a = f.gets
    if ! a then
      exit
    end
    a.chomp!
    b = f.gets.chomp
    query = [a,b]
  elsif (inputType == :nLines) then
    a = f.gets
    if ! a then
      exit
    end
    n = a.chomp.to_i
    query = n.map { | i |
      f.gets.chomp
    }    
  end
  
  aa = f.gets
  if ! aa then
    r = main(query) 
    r.each { | x | puts x }
    exit
  elsif ( aa.chomp == "---") then
    oks = []
    while true
      s = f.gets.chomp
      if (s == "---") then
        break
      end
      oks.push s
    end

    if (target == nil || t == target) then
      if target then
        TEST = true
      end

      puts "--- " + t.to_s + " ---"
      r = main(query)    

      if r.join('\n') == oks.join('\n') then
        puts "RESULT:"
        r.each { | x | puts x }
        puts "OK"
      else
        puts "RESULT:NG"
        r.each { | x | puts x }
        puts "NG!!!!!!!!!"
        ng.push t
      end
    end
  end
  t = t + 1
end
puts "---"
puts "NG targes = " + ng.to_s
