import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))

def check(a, b, c):
    if a == b or a == c or b == c:
        return False
    if a + b <= c:
        return False
    if a + c <= b:
        return False
    if b + c <= a:
        return False
    return True

n = ini()
a = inl()
ans = 0
for i in range(n):
    for j in range(i+1, n):
        for t in range(j+1, n):
            if check(a[i], a[j], a[t]):
                ans += 1
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline ins = lambda: input().rstrip() ins lambda: input().rstrip() input().rstrip() ().rstrip () input rstrip ini = lambda: int(input().rstrip()) ini lambda: int(input().rstrip()) int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip inm = lambda: map(int, input().rstrip().split()) inm lambda: map(int, input().rstrip().split()) map(int, input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split inl = lambda: list(map(int, input().split())) inl lambda: list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split out = lambda x, s='\n': print(s.join(map(str, x))) out lambda x, s='\n': print(s.join(map(str, x))) print(s.join(map(str, x))) print s.join(map(str, x)) s.join s join map(str, x) map str x x s='\n' '\n' def check(a, b, c):
    if a == b or a == c or b == c:
        return False
    if a + b <= c:
        return False
    if a + c <= b:
        return False
    if b + c <= a:
        return False
    return True check if a == b or a == c or b == c:
        return False
     a == b or a == c or b == c a == b or a == c a == b a b a == c a c b == c b c return False False if a + b <= c:
        return False
     a + b <= c a + b a b c return False False if a + c <= b:
        return False
     a + c <= b a + c a c b return False False if b + c <= a:
        return False
     b + c <= a b + c b c a return False False return True True a a b b c c n = ini() n ini() ini a = inl() a inl() inl ans = 0 ans 0 for i in range(n):
    for j in range(i+1, n):
        for t in range(j+1, n):
            if check(a[i], a[j], a[t]):
                ans += 1 i range(n) range n for j in range(i+1, n):
        for t in range(j+1, n):
            if check(a[i], a[j], a[t]):
                ans += 1 j range(i+1, n) range i+1 i 1 n for t in range(j+1, n):
            if check(a[i], a[j], a[t]):
                ans += 1 t range(j+1, n) range j+1 j 1 n if check(a[i], a[j], a[t]):
                ans += 1 check(a[i], a[j], a[t]) check a[i] a i a[j] a j a[t] a t ans += 1 ans 1 print(ans) print ans def check(a, b, c):
    if a == b or a == c or b == c:
        return False
    if a + b <= c:
        return False
    if a + c <= b:
        return False
    if b + c <= a:
        return False
    return True def check(a, b, c):
    if a == b or a == c or b == c:
        return False
    if a + b <= c:
        return False
    if a + c <= b:
        return False
    if b + c <= a:
        return False
    return True check ins = lambda: input().rstrip() lambda: input().rstrip() ins a = inl() inl() a input = sys.stdin.readline sys.stdin.readline input ini = lambda: int(input().rstrip()) lambda: int(input().rstrip()) ini inl = lambda: list(map(int, input().split())) lambda: list(map(int, input().split())) inl out = lambda x, s='\n': print(s.join(map(str, x))) lambda x, s='\n': print(s.join(map(str, x))) out ans = 0 0 ans inm = lambda: map(int, input().rstrip().split()) lambda: map(int, input().rstrip().split()) inm ans += 1 1 ans n = ini() ini() n
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))

def check(a, b, c):
    if a == b or a == c or b == c:
        return False
    if a + b <= c:
        return False
    if a + c <= b:
        return False
    if b + c <= a:
        return False
    return True

n = ini()
a = inl()
ans = 0
for i in range(n):
    for j in range(i+1, n):
        for t in range(j+1, n):
            if check(a[i], a[j], a[t]):
                ans += 1
print(ans)