from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = int(input())
l_list = list(map(int, input().split()))
l_combo = itertools.combinations(l_list, 3)
ans = 0
for i in l_combo:
    if i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] and i[1] != i[2] and i[0] != i[2]:
        ans += 1

print(ans) from collections import defaultdict, deque import sys, heapq, bisect, math, itertools, string, queue, copy, time sys heapq bisect math itertools string queue copy time from fractions import gcd import numpy as np numpy sys.setrecursionlimit(10**8) sys.setrecursionlimit sys setrecursionlimit 10**8 10 8 INF = float('inf') INF float('inf') float 'inf' MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 EPS = 10**-7 EPS 10**-7 10 -7 def inp(): return int(sys.stdin.readline()) inp def inpl(): return list(map(int, sys.stdin.readline().split())) inpl def inpl_str(): return list(sys.stdin.readline().split()) inpl_str n = int(input()) n int(input()) int input() input l_list = list(map(int, input().split())) l_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split l_combo = itertools.combinations(l_list, 3) l_combo itertools.combinations(l_list, 3) itertools.combinations itertools combinations l_list 3 ans = 0 ans 0 for i in l_combo:
    if i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] and i[1] != i[2] and i[0] != i[2]:
        ans += 1 i l_combo if i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] and i[1] != i[2] and i[0] != i[2]:
        ans += 1 i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] and i[1] != i[2] and i[0] != i[2] i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] and i[1] != i[2] i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] i[0] + i[1] > i[2] and i[1]+i[2] > i[0] i[0] + i[1] > i[2] i[0] + i[1] i[0] i 0 i[1] i 1 i[2] i 2 i[1]+i[2] > i[0] i[1]+i[2] i[1] i 1 i[2] i 2 i[0] i 0 i[0] + i[2] > i[1] i[0] + i[2] i[0] i 0 i[2] i 2 i[1] i 1 i[0] != i[1] i[0] i 0 i[1] i 1 i[1] != i[2] i[1] i 1 i[2] i 2 i[0] != i[2] i[0] i 0 i[2] i 2 ans += 1 ans 1 print(ans) print ans def inpl(): return list(map(int, sys.stdin.readline().split())) def inpl(): return list(map(int, sys.stdin.readline().split())) inpl l_combo = itertools.combinations(l_list, 3) itertools.combinations(l_list, 3) l_combo ans = 0 0 ans ans += 1 1 ans n = int(input()) int(input()) n def inpl_str(): return list(sys.stdin.readline().split()) def inpl_str(): return list(sys.stdin.readline().split()) inpl_str INF = float('inf') float('inf') INF EPS = 10**-7 10**-7 EPS l_list = list(map(int, input().split())) list(map(int, input().split())) l_list def inp(): return int(sys.stdin.readline()) def inp(): return int(sys.stdin.readline()) inp MOD = 10**9+7 10**9+7 MOD
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = int(input())
l_list = list(map(int, input().split()))
l_combo = itertools.combinations(l_list, 3)
ans = 0
for i in l_combo:
    if i[0] + i[1] > i[2] and i[1]+i[2] > i[0] and i[0] + i[2] > i[1] and i[0] != i[1] and i[1] != i[2] and i[0] != i[2]:
        ans += 1

print(ans)
