import numpy as np
from numba import *


N = int(input())
length = np.array(input().split(), np.int64)


length = np.sort(length)


def calc(length):
    cnt = 0
    
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
    return (cnt)

ans = calc(length)
print(ans) import numpy as np numpy from numba import * N = int(input()) N int(input()) int input() input length = np.array(input().split(), np.int64) length np.array(input().split(), np.int64) np.array np array input().split() ().split () input split np.int64 np int64 length = np.sort(length) length np.sort(length) np.sort np sort length def calc(length):
    cnt = 0
    
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
    return (cnt) calc cnt = 0 cnt 0 for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
     i range(N) range N for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
     j range(i + 1, N) range i + 1 i 1 N for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
     k range(j + 1, N) range j + 1 j 1 N l1, l2, l3 = length[i], length[j], length[k] l1 length[i] length i l2 length[j] length j l3 length[k] length k if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
     l1 != l2 and l1 != l3 and l2 != l3 l1 != l2 and l1 != l3 l1 != l2 l1 l2 l1 != l3 l1 l3 l2 != l3 l2 l3 if (l1 + l2 > l3):
                        cnt += 1
    
     l1 + l2 > l3 l1 + l2 l1 l2 l3 cnt += 1 cnt 1 return (cnt) cnt length length ans = calc(length) ans calc(length) calc length print(ans) print ans N = int(input()) int(input()) N length = np.sort(length) np.sort(length) length length = np.array(input().split(), np.int64) np.array(input().split(), np.int64) length ans = calc(length) calc(length) ans def calc(length):
    cnt = 0
    
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
    return (cnt) def calc(length):
    cnt = 0
    
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
    return (cnt) calc
import numpy as np
from numba import *


N = int(input())
length = np.array(input().split(), np.int64)


length = np.sort(length)


def calc(length):
    cnt = 0
    
    for i in range(N):
        for j in range(i + 1, N):
            for k in range(j + 1, N):
                l1, l2, l3 = length[i], length[j], length[k]
                if (l1 != l2 and l1 != l3 and l2 != l3):
                    if (l1 + l2 > l3):
                        cnt += 1
    
    return (cnt)

ans = calc(length)
print(ans)
