def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main() def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans) main n = int(input()) n int(input()) int input() input ls = sorted(list(map(int, input().split()))) ls 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, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

     i li enumerate(ls) enumerate ls for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

     j lj enumerate(ls[i+1:]) enumerate ls[i+1:] ls i+1: i+1 i 1 if li == lj:
                continue
             li == lj li lj continue for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

     lk ls[i+j+2:] ls i+j+2: i+j+2 i+j i j 2 if lj == lk:
                    continue

                 lj == lk lj lk continue if li + lj > lk:
                    ans += 1

     li + lj > lk li + lj li lj lk ans += 1 ans 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans) def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans) main
def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()
