#! env/bin/local python3

# -*- coding: utf-8 -*-



from itertools import combinations





def is_tri(_a, _b, _c):

    if (_a + _b > _c) and (_b + _c > _a) and (_c + _a > _b):

        return True

    else:

        return False





n = int(eval(input()))

sticks = list(map(int, input().split()))



h = combinations(sticks, 3)



counter = 0

for a, b, c in h:

    if is_tri(a, b, c):

        a, b, c = sorted([a, b, c])

        if (a != b) and (b != c):

            counter += 1



print(counter)

#! env/bin/local python3

# -*- coding: utf-8 -*-



from itertools import combinations





def is_tri(_a, _b, _c):

    if (_a + _b > _c) and (_b + _c > _a) and (_c + _a > _b):

        return True

    else:

        return False





n = int(eval(input()))

sticks = list(map(int, input().split()))



h = combinations(sticks, 3)



counter = 0

for a, b, c in h:

    if is_tri(a, b, c):

        # a, b, c = sorted([a, b, c])

        if (a != b) and (b != c) and (c != a):

            counter += 1



print(counter)

#! env/bin/local python3
# -*- coding: utf-8 -*-
from itertools import combinations


def is_tri(_a, _b, _c):
    if (_a + _b > _c) and (_b + _c > _a) and (_c + _a > _b):
        return True
    else:
        return False


n = int(eval(input()))
sticks = list(map(int, input().split()))
h = combinations(sticks, 3)
counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        a, b, c = sorted([a, b, c])
        if (a != b) and (b != c):
            counter += 1
print(counter)

#! env/bin/local python3
# -*- coding: utf-8 -*-
from itertools import combinations


def is_tri(_a, _b, _c):
    if (_a + _b > _c) and (_b + _c > _a) and (_c + _a > _b):
        return True
    else:
        return False


n = int(eval(input()))
sticks = list(map(int, input().split()))
h = combinations(sticks, 3)
counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        # a, b, c = sorted([a, b, c])
        if (a != b) and (b != c) and (c != a):
            counter += 1
print(counter)

-        a, b, c = sorted([a, b, c]) -        if (a != b) and (b != c): +        # a, b, c = sorted([a, b, c]) +        if (a != b) and (b != c) and (c != a):