n = int(input())
L = list(map(int, input().split()))

from itertools import combinations

cnt = 0
for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1
print(cnt) n = int(input()) n int(input()) int input() input L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split from itertools import combinations cnt = 0 cnt 0 for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1 i combinations(L, 3) combinations L 3 longest = max(i) longest max(i) max i rest = sum(i) - max(i) rest sum(i) - max(i) sum(i) sum i max(i) max i if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1 longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] longest < rest and i[0] != i[1] and i[0] != i[2] longest < rest and i[0] != i[1] longest < rest longest rest i[0] != i[1] i[0] i 0 i[1] i 1 i[0] != i[2] i[0] i 0 i[2] i 2 i[1] != i[2] i[1] i 1 i[2] i 2 cnt += 1 cnt 1 print(cnt) print cnt cnt = 0 0 cnt n = int(input()) int(input()) n cnt += 1 1 cnt rest = sum(i) - max(i) sum(i) - max(i) rest longest = max(i) max(i) longest L = list(map(int, input().split())) list(map(int, input().split())) L
n = int(input())
L = list(map(int, input().split()))

from itertools import combinations

cnt = 0
for i in combinations(L, 3):
    longest = max(i)
    rest = sum(i) - max(i)
    if longest < rest and i[0] != i[1] and i[0] != i[2] and i[1] != i[2] :
        cnt += 1
print(cnt)