#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
from bisect import bisect_left
from itertools import product
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def LF(): return list(map(float, input().split()))
def LC(): return [c for c in input().split()]
def LLI(n): return [LI() for _ in range(n)]
def NSTR(n): return [input() for _ in range(n)]

def array2d(N, M, initial=0):
    return [[initial]*M for _ in range(N)]

def copy2d(orig, N, M):
    ret = array2d(N, M)
    for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
    return ret


INF = float("inf")
MOD = 10**9 + 7


def main():
    N = INT()
    L = LI()
    L.sort()
    counter = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
    print(counter)
    return


if __name__ == '__main__':
    main() import sys sys sys.setrecursionlimit(10**8) sys.setrecursionlimit sys setrecursionlimit 10**8 10 8 from bisect import bisect_left from itertools import product def input(): return sys.stdin.readline().strip() input def INT(): return int(input()) INT def MAP(): return map(int, input().split()) MAP def LI(): return list(map(int, input().split())) LI def LI_(): return list(map(lambda x: int(x)-1, input().split())) LI_ def LF(): return list(map(float, input().split())) LF c for c in input().split() for c in input().split() c input().split() ().split () input split for c in input().split() c def LC(): return [c for c in input().split()] LC LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LLI(n): return [LI() for _ in range(n)] LLI n n input() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input() input def NSTR(n): return [input() for _ in range(n)] NSTR n n def array2d(N, M, initial=0):
    return [[initial]*M for _ in range(N)] array2d [initial]*M for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) [initial]*M [initial] initial M return [[initial]*M for _ in range(N)] [[initial]*M for _ in range(N)] N N M M initial=0 initial 0 def copy2d(orig, N, M):
    ret = array2d(N, M)
    for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
    return ret copy2d ret = array2d(N, M) ret array2d(N, M) array2d N M for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
     i range(N) range N for j in range(M):
            ret[i][j] = orig[i][j]
     j range(M) range M ret[i][j] = orig[i][j] ret[i][j] [i] ret i j orig[i][j] [i] orig i j return ret ret orig orig N N M M INF = float("inf") INF float("inf") float "inf" MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 def main():
    N = INT()
    L = LI()
    L.sort()
    counter = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
    print(counter)
    return main N = INT() N INT() INT L = LI() L LI() LI L.sort() L.sort L sort counter = 0 counter 0 for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
     i range(N) range N for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
     j range(i+1, N) range i+1 i 1 N for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
     k range(j+1, N) range j+1 j 1 N if L[i] == L[j] or L[j] == L[k]:
                    continue
                 L[i] == L[j] or L[j] == L[k] L[i] == L[j] L[i] L i L[j] L j L[j] == L[k] L[j] L j L[k] L k continue if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
     L[i]+L[j] > L[k] L[i]+L[j] L[i] L i L[j] L j L[k] L k counter += 1 counter 1 print(counter) print counter return if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def MAP(): return map(int, input().split()) def MAP(): return map(int, input().split()) MAP def array2d(N, M, initial=0):
    return [[initial]*M for _ in range(N)] def array2d(N, M, initial=0):
    return [[initial]*M for _ in range(N)] array2d MOD = 10**9 + 7 10**9 + 7 MOD def INT(): return int(input()) def INT(): return int(input()) INT INF = float("inf") float("inf") INF def LLI(n): return [LI() for _ in range(n)] def LLI(n): return [LI() for _ in range(n)] LLI def NSTR(n): return [input() for _ in range(n)] def NSTR(n): return [input() for _ in range(n)] NSTR def LF(): return list(map(float, input().split())) def LF(): return list(map(float, input().split())) LF def main():
    N = INT()
    L = LI()
    L.sort()
    counter = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
    print(counter)
    return def main():
    N = INT()
    L = LI()
    L.sort()
    counter = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
    print(counter)
    return main def LC(): return [c for c in input().split()] def LC(): return [c for c in input().split()] LC def copy2d(orig, N, M):
    ret = array2d(N, M)
    for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
    return ret def copy2d(orig, N, M):
    ret = array2d(N, M)
    for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
    return ret copy2d def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def LI_(): return list(map(lambda x: int(x)-1, input().split())) def LI_(): return list(map(lambda x: int(x)-1, input().split())) LI_
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
from bisect import bisect_left
from itertools import product
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def LF(): return list(map(float, input().split()))
def LC(): return [c for c in input().split()]
def LLI(n): return [LI() for _ in range(n)]
def NSTR(n): return [input() for _ in range(n)]

def array2d(N, M, initial=0):
    return [[initial]*M for _ in range(N)]

def copy2d(orig, N, M):
    ret = array2d(N, M)
    for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
    return ret


INF = float("inf")
MOD = 10**9 + 7


def main():
    N = INT()
    L = LI()
    L.sort()
    counter = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or L[j] == L[k]:
                    continue
                if L[i]+L[j] > L[k]:
                    counter += 1
                    # print(L[i], L[j], L[k])
    print(counter)
    return


if __name__ == '__main__':
    main()
