n = int(input())
line = input().split()

length = [int(line[i]) for i in range(n)]
length.sort(reverse = True)

count = 0

for i in range(n-2):
  long = length[i]
  
  for j in range(i+1,n-1):
    middle = length[j]
    if middle == long:
      continue
    if middle*2 <= long :
      break
      
    for k in range(j+1,n):
      short = length[k]
      if short == middle:
        continue
      if short + middle > long:
        count += 1
      else:
        break

print(count) n = int(input()) n int(input()) int input() input line = input().split() line input().split() ().split () input split int(line[i]) for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(line[i]) int line[i] line i length = [int(line[i]) for i in range(n)] length [int(line[i]) for i in range(n)] length.sort(reverse = True) length.sort length sort reverse = True reverse True count = 0 count 0 for i in range(n-2):
  long = length[i]
  
  for j in range(i+1,n-1):
    middle = length[j]
    if middle == long:
      continue
    if middle*2 <= long :
      break
      
    for k in range(j+1,n):
      short = length[k]
      if short == middle:
        continue
      if short + middle > long:
        count += 1
      else:
        break i range(n-2) range n-2 n 2 long = length[i] long length[i] length i for j in range(i+1,n-1):
    middle = length[j]
    if middle == long:
      continue
    if middle*2 <= long :
      break
      
    for k in range(j+1,n):
      short = length[k]
      if short == middle:
        continue
      if short + middle > long:
        count += 1
      else:
        break j range(i+1,n-1) range i+1 i 1 n-1 n 1 middle = length[j] middle length[j] length j if middle == long:
      continue
     middle == long middle long continue if middle*2 <= long :
      break
      
     middle*2 <= long middle*2 middle 2 long break for k in range(j+1,n):
      short = length[k]
      if short == middle:
        continue
      if short + middle > long:
        count += 1
      else:
        break k range(j+1,n) range j+1 j 1 n short = length[k] short length[k] length k if short == middle:
        continue
       short == middle short middle continue if short + middle > long:
        count += 1
      else:
        break short + middle > long short + middle short middle long count += 1 count 1 break print(count) print count line = input().split() input().split() line count = 0 0 count long = length[i] length[i] long count += 1 1 count middle = length[j] length[j] middle short = length[k] length[k] short n = int(input()) int(input()) n length = [int(line[i]) for i in range(n)] [int(line[i]) for i in range(n)] length
n = int(input())
line = input().split()

length = [int(line[i]) for i in range(n)]
length.sort(reverse = True)

count = 0

for i in range(n-2):
  long = length[i]
  
  for j in range(i+1,n-1):
    middle = length[j]
    if middle == long:
      continue
    if middle*2 <= long :
      break
      
    for k in range(j+1,n):
      short = length[k]
      if short == middle:
        continue
      if short + middle > long:
        count += 1
      else:
        break

print(count)