import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    L = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
    print(ans)

if __name__=='__main__':
    main() import sys sys def input(): return sys.stdin.readline().rstrip() input def main():
    n = int(input())
    L = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
    print(ans) main n = int(input()) n int(input()) int input() input L = sorted(list(map(int,input().split()))) L sorted(list(map(int,input().split()))) sorted 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(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
     i range(n-2) range n-2 n 2 for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
     j range(i,n-1) range i n-1 n 1 if L[i] == L[j]: 
                continue
             L[i] == L[j] L[i] L i L[j] L j continue for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
     k range(j,n) range j n if L[j] == L[k]:
                    continue
                 L[j] == L[k] L[j] L j L[k] L k continue if L[i]+L[j] <= L[k]:
                    break
                 L[i]+L[j] <= L[k] L[i]+L[j] L[i] L i L[j] L j L[k] L k break ans+=1 ans 1 print(ans) print ans if __name__=='__main__':
    main() __name__=='__main__' __name__ '__main__' main() main def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input def main():
    n = int(input())
    L = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
    print(ans) def main():
    n = int(input())
    L = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
    print(ans) main
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    L = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
    print(ans)

if __name__=='__main__':
    main()