from itertools import combinations

N = int(input())
a = list(map(int, input().split()))
count = 0
for i in combinations(a,3):
    b = list(i)
    b.sort()
    if b[2] > b[1] and b[1] > b[0]:
        if b[2] < (b[1] + b[0]):
            count += 1

print(count) from itertools import combinations N = int(input()) N int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 for i in combinations(a,3):
    b = list(i)
    b.sort()
    if b[2] > b[1] and b[1] > b[0]:
        if b[2] < (b[1] + b[0]):
            count += 1 i combinations(a,3) combinations a 3 b = list(i) b list(i) list i b.sort() b.sort b sort if b[2] > b[1] and b[1] > b[0]:
        if b[2] < (b[1] + b[0]):
            count += 1 b[2] > b[1] and b[1] > b[0] b[2] > b[1] b[2] b 2 b[1] b 1 b[1] > b[0] b[1] b 1 b[0] b 0 if b[2] < (b[1] + b[0]):
            count += 1 b[2] < (b[1] + b[0]) b[2] b 2 b[1] + b[0] b[1] b 1 b[0] b 0 count += 1 count 1 print(count) print count b = list(i) list(i) b count += 1 1 count a = list(map(int, input().split())) list(map(int, input().split())) a N = int(input()) int(input()) N count = 0 0 count
from itertools import combinations

N = int(input())
a = list(map(int, input().split()))
count = 0
for i in combinations(a,3):
    b = list(i)
    b.sort()
    if b[2] > b[1] and b[1] > b[0]:
        if b[2] < (b[1] + b[0]):
            count += 1

print(count)