# string
# a, b, c = input().split()
# str_list = list(input().split())

# number
# a, b, c = map(int, input().split())
# num_list = list(map(int, input().split()))

# lows
# str_list = [input() for _ in range(n)]

# many inputs
# num_list = []
# for i in range(n): num_list.append(list(map(int, input().split())))

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

l.sort(reverse = True)

ctr = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        if l[i] == l[j]:
            continue
        for k in range(j+1, n):
            if l[j] == l[k]:
                continue
            if l[i] < l[j] + l[k]:
                ctr += 1

print(ctr) 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 l.sort(reverse = True) l.sort l sort reverse = True reverse True ctr = 0 ctr 0 for i in range(n-2):
    for j in range(i+1, n-1):
        if l[i] == l[j]:
            continue
        for k in range(j+1, n):
            if l[j] == l[k]:
                continue
            if l[i] < l[j] + l[k]:
                ctr += 1 i range(n-2) range n-2 n 2 for j in range(i+1, n-1):
        if l[i] == l[j]:
            continue
        for k in range(j+1, n):
            if l[j] == l[k]:
                continue
            if l[i] < l[j] + l[k]:
                ctr += 1 j range(i+1, n-1) range i+1 i 1 n-1 n 1 if l[i] == l[j]:
            continue
         l[i] == l[j] l[i] l i l[j] l j continue for k in range(j+1, n):
            if l[j] == l[k]:
                continue
            if l[i] < l[j] + l[k]:
                ctr += 1 k range(j+1, n) range j+1 j 1 n if l[j] == l[k]:
                continue
             l[j] == l[k] l[j] l j l[k] l k continue if l[i] < l[j] + l[k]:
                ctr += 1 l[i] < l[j] + l[k] l[i] l i l[j] + l[k] l[j] l j l[k] l k ctr += 1 ctr 1 print(ctr) print ctr n = int(input()) int(input()) n ctr += 1 1 ctr ctr = 0 0 ctr l = list(map(int, input().split())) list(map(int, input().split())) l
# string
# a, b, c = input().split()
# str_list = list(input().split())

# number
# a, b, c = map(int, input().split())
# num_list = list(map(int, input().split()))

# lows
# str_list = [input() for _ in range(n)]

# many inputs
# num_list = []
# for i in range(n): num_list.append(list(map(int, input().split())))

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

l.sort(reverse = True)

ctr = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        if l[i] == l[j]:
            continue
        for k in range(j+1, n):
            if l[j] == l[k]:
                continue
            if l[i] < l[j] + l[k]:
                ctr += 1

print(ctr)