from itertools import combinations

N = int(input())
L = list(map(int, input().split()))
ans = 0
for v in combinations(L, 3):
    if len(set(v)) == 3:
        a, b, c = v
        if a + b > c and c + a > b and b + c > a:
            ans += 1
print(ans) from itertools import combinations 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 for v in combinations(L, 3):
    if len(set(v)) == 3:
        a, b, c = v
        if a + b > c and c + a > b and b + c > a:
            ans += 1 v combinations(L, 3) combinations L 3 if len(set(v)) == 3:
        a, b, c = v
        if a + b > c and c + a > b and b + c > a:
            ans += 1 len(set(v)) == 3 len(set(v)) len set(v) set v 3 a, b, c = v a v b c if a + b > c and c + a > b and b + c > a:
            ans += 1 a + b > c and c + a > b and b + c > a a + b > c and c + a > b a + b > c a + b a b c c + a > b c + a c a b b + c > a b + c b c a ans += 1 ans 1 print(ans) print ans a, b, c = v v a c = v v c N = int(input()) int(input()) N ans += 1 1 ans L = list(map(int, input().split())) list(map(int, input().split())) L ans = 0 0 ans b, c = v v b
from itertools import combinations

N = int(input())
L = list(map(int, input().split()))
ans = 0
for v in combinations(L, 3):
    if len(set(v)) == 3:
        a, b, c = v
        if a + b > c and c + a > b and b + c > a:
            ans += 1
print(ans)