def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

n = iinp()
l = lmiinps()

ans = 0

if n < 3:
    print(0)
    exit()

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] or l[i] == l[k]:
                continue
            if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                ans += 1

print(ans) def inp():
    return input() inp return input() input() input def iinp():
    return int(input()) iinp return int(input()) int(input()) int input() input def inps():
    return input().split() inps return input().split() input().split() ().split () input split def miinps():
    return map(int,input().split()) miinps return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def linps():
    return list(input().split()) linps return list(input().split()) list(input().split()) list input().split() ().split () input split def lmiinps():
    return list(map(int,input().split())) lmiinps return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)] lmiinpsf list(map(int,input().split()))for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split return [list(map(int,input().split()))for _ in range(n)] [list(map(int,input().split()))for _ in range(n)] n n n = iinp() n iinp() iinp l = lmiinps() l lmiinps() lmiinps ans = 0 ans 0 if n < 3:
    print(0)
    exit() n < 3 n 3 print(0) print 0 exit() exit 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] or l[i] == l[k]:
                continue
            if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                ans += 1 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] or l[i] == l[k]:
                continue
            if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                ans += 1 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] or l[i] == l[k]:
                continue
            if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                ans += 1 k range(j+1,n) range j+1 j 1 n if l[i] == l[j] or l[j] == l[k] or l[i] == l[k]:
                continue
             l[i] == l[j] or l[j] == l[k] or l[i] == l[k] 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 l[i] == l[k] l[i] l i l[k] l k continue if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                ans += 1 l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j] l[i]+l[j] > l[k] and l[j]+l[k] > l[i] l[i]+l[j] > l[k] l[i]+l[j] l[i] l i l[j] l j l[k] l k l[j]+l[k] > l[i] l[j]+l[k] l[j] l j l[k] l k l[i] l i l[k]+l[i] > l[j] l[k]+l[i] l[k] l k l[i] l i l[j] l j ans += 1 ans 1 print(ans) print ans def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)] def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)] lmiinpsf def linps():
    return list(input().split()) def linps():
    return list(input().split()) linps n = iinp() iinp() n def miinps():
    return map(int,input().split()) def miinps():
    return map(int,input().split()) miinps def inp():
    return input() def inp():
    return input() inp def lmiinps():
    return list(map(int,input().split())) def lmiinps():
    return list(map(int,input().split())) lmiinps ans += 1 1 ans ans = 0 0 ans def inps():
    return input().split() def inps():
    return input().split() inps def iinp():
    return int(input()) def iinp():
    return int(input()) iinp l = lmiinps() lmiinps() l
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

n = iinp()
l = lmiinps()

ans = 0

if n < 3:
    print(0)
    exit()

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] or l[i] == l[k]:
                continue
            if l[i]+l[j] > l[k] and l[j]+l[k] > l[i] and l[k]+l[i] > l[j]:
                ans += 1

print(ans)