n = int(input())
l = sorted([int(i) for i in input().split(' ')])

if len(l) < 3:
    print(0)
    exit()

count = 0

for i in range(0, (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]:
                count += 1

print(count) n = int(input()) n int(input()) int input() input int(i) for i in input().split(' ') for i in input().split(' ') i input().split(' ') ().split () input split ' ' for i in input().split(' ') int(i) int i l = sorted([int(i) for i in input().split(' ')]) l sorted([int(i) for i in input().split(' ')]) sorted [int(i) for i in input().split(' ')] if len(l) < 3:
    print(0)
    exit() len(l) < 3 len(l) len l 3 print(0) print 0 exit() exit count = 0 count 0 for i in range(0, (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]:
                count += 1 i range(0, (n - 2)) range 0 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]:
                count += 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]:
                count += 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]:
                count += 1 l[i] + l[j] > l[k] l[i] + l[j] l[i] l i l[j] l j l[k] l k count += 1 count 1 print(count) print count count = 0 0 count l = sorted([int(i) for i in input().split(' ')]) sorted([int(i) for i in input().split(' ')]) l count += 1 1 count n = int(input()) int(input()) n
n = int(input())
l = sorted([int(i) for i in input().split(' ')])

if len(l) < 3:
    print(0)
    exit()

count = 0

for i in range(0, (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]:
                count += 1

print(count)