def solve(n, arr):
    # Firstly sort the array to reduce amount of calculation
    arr.sort()

    ans = 0

    for (i, _) in enumerate(arr):
        for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
    return ans


if __name__ == "__main__":
    n = int(input())
    arr = list(map(int, input().split(' ')))
    print(solve(n, arr)) def solve(n, arr):
    # Firstly sort the array to reduce amount of calculation
    arr.sort()

    ans = 0

    for (i, _) in enumerate(arr):
        for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
    return ans solve arr.sort() arr.sort arr sort ans = 0 ans 0 for (i, _) in enumerate(arr):
        for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
     (i, _) i _ enumerate(arr) enumerate arr for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
     j range(i + 1, len(arr)) range i + 1 i 1 len(arr) len arr for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
     k range(j + 1, len(arr)) range j + 1 j 1 len(arr) len arr if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
     arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k] arr[i] != arr[j] and arr[i] != arr[k] arr[i] != arr[j] arr[i] arr i arr[j] arr j arr[i] != arr[k] arr[i] arr i arr[k] arr k arr[j] != arr[k] arr[j] arr j arr[k] arr k if arr[i] + arr[j] > arr[k]:
                        ans += 1
     arr[i] + arr[j] > arr[k] arr[i] + arr[j] arr[i] arr i arr[j] arr j arr[k] arr k ans += 1 ans 1 return ans ans n n arr arr if __name__ == "__main__":
    n = int(input())
    arr = list(map(int, input().split(' ')))
    print(solve(n, arr)) __name__ == "__main__" __name__ "__main__" n = int(input()) n int(input()) int input() input arr = list(map(int, input().split(' '))) arr list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' print(solve(n, arr)) print solve(n, arr) solve n arr def solve(n, arr):
    # Firstly sort the array to reduce amount of calculation
    arr.sort()

    ans = 0

    for (i, _) in enumerate(arr):
        for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
    return ans def solve(n, arr):
    # Firstly sort the array to reduce amount of calculation
    arr.sort()

    ans = 0

    for (i, _) in enumerate(arr):
        for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
    return ans solve arr = list(map(int, input().split(' '))) list(map(int, input().split(' '))) arr n = int(input()) int(input()) n
def solve(n, arr):
    # Firstly sort the array to reduce amount of calculation
    arr.sort()

    ans = 0

    for (i, _) in enumerate(arr):
        for j in range(i + 1, len(arr)):
            for k in range(j + 1, len(arr)):
                if arr[i] != arr[j] and arr[i] != arr[k] and arr[j] != arr[k]:
                    if arr[i] + arr[j] > arr[k]:
                        ans += 1
    return ans


if __name__ == "__main__":
    n = int(input())
    arr = list(map(int, input().split(' ')))
    print(solve(n, arr))