#B問題

N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(0,len(A)):
    for j in range(i+1,len(A)):
        for k in range(j+1,len(A)):
            if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] :
                ans += 1
print(ans) N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in range(0,len(A)):
    for j in range(i+1,len(A)):
        for k in range(j+1,len(A)):
            if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] :
                ans += 1 i range(0,len(A)) range 0 len(A) len A for j in range(i+1,len(A)):
        for k in range(j+1,len(A)):
            if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] :
                ans += 1 j range(i+1,len(A)) range i+1 i 1 len(A) len A for k in range(j+1,len(A)):
            if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] :
                ans += 1 k range(j+1,len(A)) range j+1 j 1 len(A) len A if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] :
                ans += 1 A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] A[i] + A[j] > A[k] and A[j] + A[k] > A[i] A[i] + A[j] > A[k] A[i] + A[j] A[i] A i A[j] A j A[k] A k A[j] + A[k] > A[i] A[j] + A[k] A[j] A j A[k] A k A[i] A i A[k] + A[i] > A[j] A[k] + A[i] A[k] A k A[i] A i A[j] A j A[i] != A[j] A[i] A i A[j] A j A[j] != A[k] A[j] A j A[k] A k A[k] != A[i] A[k] A k A[i] A i ans += 1 ans 1 print(ans) print ans A = list(map(int, input().split())) list(map(int, input().split())) A ans += 1 1 ans N = int(input()) int(input()) N ans = 0 0 ans
#B問題

N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(0,len(A)):
    for j in range(i+1,len(A)):
        for k in range(j+1,len(A)):
            if A[i] + A[j] > A[k] and A[j] + A[k] > A[i] and A[k] + A[i] > A[j] and A[i] != A[j] and A[j] != A[k] and A[k] != A[i] :
                ans += 1
print(ans)