import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N = int(readline())
    L = [int(i) for i in readline().split()]
    #まず三角形ができる組みを考える
    #三重ループでも間に合うので三重ループを回す
    L.sort()
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
    print(cnt)
if __name__ == '__main__':
    main() import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines def main():
    N = int(readline())
    L = [int(i) for i in readline().split()]
    #まず三角形ができる組みを考える
    #三重ループでも間に合うので三重ループを回す
    L.sort()
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
    print(cnt) main N = int(readline()) N int(readline()) int readline() readline int(i) for i in readline().split() for i in readline().split() i readline().split() ().split () readline split for i in readline().split() int(i) int i L = [int(i) for i in readline().split()] L [int(i) for i in readline().split()] L.sort() L.sort L sort cnt = 0 cnt 0 for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
     i range(N) range N for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
     j range(i+1, N) range i+1 i 1 N for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
     k range(j+1, N) range j+1 j 1 N if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
     L[k] < L[i] + L[j] L[k] L k L[i] + L[j] L[i] L i L[j] L j if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
     (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]) (L[i] != L[j]) & (L[j] != L[k]) 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 cnt += 1 cnt 1 print(cnt) print cnt if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines def main():
    N = int(readline())
    L = [int(i) for i in readline().split()]
    #まず三角形ができる組みを考える
    #三重ループでも間に合うので三重ループを回す
    L.sort()
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
    print(cnt) def main():
    N = int(readline())
    L = [int(i) for i in readline().split()]
    #まず三角形ができる組みを考える
    #三重ループでも間に合うので三重ループを回す
    L.sort()
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
    print(cnt) main readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline read = sys.stdin.buffer.read sys.stdin.buffer.read read
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N = int(readline())
    L = [int(i) for i in readline().split()]
    #まず三角形ができる組みを考える
    #三重ループでも間に合うので三重ループを回す
    L.sort()
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[k] < L[i] + L[j]:
                    if (L[i] != L[j]) & (L[j] != L[k]) & (L[k] != L[i]):
                        cnt += 1
    print(cnt)
if __name__ == '__main__':
    main()