def check(a,b,c):
    if a == b:
        return False
    if b == c:
        return False
    if c == a:
        return False
    m = max(a,b,c)
    if m >= (a+b+c)-m:
        return False
    return True

N = int(input())
L = list(map(int,input().split()))
ans = 0
if N >= 3:
    for i in range(0,N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if check(L[i],L[j],L[k]):
                    ans += 1
print(ans) def check(a,b,c):
    if a == b:
        return False
    if b == c:
        return False
    if c == a:
        return False
    m = max(a,b,c)
    if m >= (a+b+c)-m:
        return False
    return True check if a == b:
        return False
     a == b a b return False False if b == c:
        return False
     b == c b c return False False if c == a:
        return False
     c == a c a return False False m = max(a,b,c) m max(a,b,c) max a b c if m >= (a+b+c)-m:
        return False
     m >= (a+b+c)-m m (a+b+c)-m a+b+c a+b a b c m return False False return True True a a b b c c 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 ans = 0 ans 0 if N >= 3:
    for i in range(0,N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if check(L[i],L[j],L[k]):
                    ans += 1 N >= 3 N 3 for i in range(0,N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if check(L[i],L[j],L[k]):
                    ans += 1 i range(0,N-2) range 0 N-2 N 2 for j in range(i+1,N-1):
            for k in range(j+1,N):
                if check(L[i],L[j],L[k]):
                    ans += 1 j range(i+1,N-1) range i+1 i 1 N-1 N 1 for k in range(j+1,N):
                if check(L[i],L[j],L[k]):
                    ans += 1 k range(j+1,N) range j+1 j 1 N if check(L[i],L[j],L[k]):
                    ans += 1 check(L[i],L[j],L[k]) check L[i] L i L[j] L j L[k] L k ans += 1 ans 1 print(ans) print ans ans += 1 1 ans L = list(map(int,input().split())) list(map(int,input().split())) L N = int(input()) int(input()) N def check(a,b,c):
    if a == b:
        return False
    if b == c:
        return False
    if c == a:
        return False
    m = max(a,b,c)
    if m >= (a+b+c)-m:
        return False
    return True def check(a,b,c):
    if a == b:
        return False
    if b == c:
        return False
    if c == a:
        return False
    m = max(a,b,c)
    if m >= (a+b+c)-m:
        return False
    return True check ans = 0 0 ans
def check(a,b,c):
    if a == b:
        return False
    if b == c:
        return False
    if c == a:
        return False
    m = max(a,b,c)
    if m >= (a+b+c)-m:
        return False
    return True

N = int(input())
L = list(map(int,input().split()))
ans = 0
if N >= 3:
    for i in range(0,N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if check(L[i],L[j],L[k]):
                    ans += 1
print(ans)