def execute(N, L):
    c = 0
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

    return c

def judge(a, b, c):
    if a==b or b==c or c==a:
        return False
    if a+b > c and b+c > a and a+c >b:
        return True
    else:
        return False

if __name__ == '__main__':
    N = int(input())
    L = list(map(int, input().split()))

    print(execute(N, L)) def execute(N, L):
    c = 0
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

    return c execute c = 0 c 0 for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

     i range(N-2) range N-2 N 2 for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

     j range(i+1,N-1) range i+1 i 1 N-1 N 1 for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

     k range(j+1,N) range j+1 j 1 N if judge(L[i], L[j], L[k]):
                    c += 1

     judge(L[i], L[j], L[k]) judge L[i] L i L[j] L j L[k] L k c += 1 c 1 return c c N N L L def judge(a, b, c):
    if a==b or b==c or c==a:
        return False
    if a+b > c and b+c > a and a+c >b:
        return True
    else:
        return False judge if a==b or b==c or c==a:
        return False
     a==b or b==c or c==a a==b or b==c a==b a b b==c b c c==a c a return False False if a+b > c and b+c > a and a+c >b:
        return True
    else:
        return False a+b > c and b+c > a and a+c >b a+b > c and b+c > a a+b > c a+b a b c b+c > a b+c b c a a+c >b a+c a c b return True True return False False a a b b c c if __name__ == '__main__':
    N = int(input())
    L = list(map(int, input().split()))

    print(execute(N, L)) __name__ == '__main__' __name__ '__main__' 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 print(execute(N, L)) print execute(N, L) execute N L L = list(map(int, input().split())) list(map(int, input().split())) L def execute(N, L):
    c = 0
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

    return c def execute(N, L):
    c = 0
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

    return c execute N = int(input()) int(input()) N def judge(a, b, c):
    if a==b or b==c or c==a:
        return False
    if a+b > c and b+c > a and a+c >b:
        return True
    else:
        return False def judge(a, b, c):
    if a==b or b==c or c==a:
        return False
    if a+b > c and b+c > a and a+c >b:
        return True
    else:
        return False judge
def execute(N, L):
    c = 0
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if judge(L[i], L[j], L[k]):
                    c += 1

    return c

def judge(a, b, c):
    if a==b or b==c or c==a:
        return False
    if a+b > c and b+c > a and a+c >b:
        return True
    else:
        return False

if __name__ == '__main__':
    N = int(input())
    L = list(map(int, input().split()))

    print(execute(N, L))