import sys
sys.setrecursionlimit(300000)
from itertools import combinations

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
L = LMI()

ans = 0
for a, b, c in combinations(L, 3):
    if a == b or b == c or c == a:
        continue
    if a + b > c and b + c > a and c + a > b:
        ans += 1
print(ans) import sys sys sys.setrecursionlimit(300000) sys.setrecursionlimit sys setrecursionlimit 300000 from itertools import combinations def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) MI0 def LMI(): return list(map(int, sys.stdin.readline().split())) LMI def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) LMI0 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('inf') INF float('inf') float 'inf' N = I() N I() I L = LMI() L LMI() LMI ans = 0 ans 0 for a, b, c in combinations(L, 3):
    if a == b or b == c or c == a:
        continue
    if a + b > c and b + c > a and c + a > b:
        ans += 1 a b c combinations(L, 3) combinations L 3 if a == b or b == c or c == a:
        continue
     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 continue if a + b > c and b + c > a and c + a > b:
        ans += 1 a + b > c and b + c > a and c + a > b a + b > c and b + c > a a + b > c a + b a b c b + c > a b + c b c a c + a > b c + a c a b ans += 1 ans 1 print(ans) print ans ans += 1 1 ans N = I() I() N def LMI(): return list(map(int, sys.stdin.readline().split())) def LMI(): return list(map(int, sys.stdin.readline().split())) LMI def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) LMI0 def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) MI0 ans = 0 0 ans MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I INF = float('inf') float('inf') INF def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI L = LMI() LMI() L
import sys
sys.setrecursionlimit(300000)
from itertools import combinations

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
L = LMI()

ans = 0
for a, b, c in combinations(L, 3):
    if a == b or b == c or c == a:
        continue
    if a + b > c and b + c > a and c + a > b:
        ans += 1
print(ans)
