from sys import stdin
input = stdin.readline
N = map(int, input().split())
L = list(map(int, input().split()))

c=0

for i in range(len(L)-2):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:c=c+1

print(c)               from sys import stdin input = stdin.readline input stdin.readline stdin readline N = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split c=0 c 0 for i in range(len(L)-2):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:c=c+1 i range(len(L)-2) range len(L)-2 len(L) len L 2 for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:c=c+1 j range(i+1,len(L)) range i+1 i 1 len(L) len L for k in range(j+1,len(L)):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:c=c+1 k range(j+1,len(L)) range j+1 j 1 len(L) len L if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k] L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i] L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] L[i]+L[j]>L[k] and L[j]+L[k]>L[i] L[i]+L[j]>L[k] L[i]+L[j] L[i] L i L[j] L j L[k] L k L[j]+L[k]>L[i] L[j]+L[k] L[j] L j L[k] L k L[i] L i L[k]+L[i]>L[j] L[k]+L[i] L[k] L k L[i] L i L[j] L j L[i]!=L[j] L[i] L i L[j] L j L[j]!=L[k] L[j] L j L[k] L k L[k]!=L[i] L[k] L k L[i] L i print(c) print c N = map(int, input().split()) map(int, input().split()) N L = list(map(int, input().split())) list(map(int, input().split())) L input = stdin.readline stdin.readline input c=0 0 c
from sys import stdin
input = stdin.readline
N = map(int, input().split())
L = list(map(int, input().split()))

c=0

for i in range(len(L)-2):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j] and L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:c=c+1

print(c)              