import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
l.sort()
ans = 0
for a in range(n):
    for b in range(a+1,n):
        for c in range(b+1,n):
            if l[a] != l[b] and l[b] != l[c] and l[a] != l[c]:
                if l[a] + l[b] > l[c]:
                    ans += 1
print(ans) import sys sys n = int(sys.stdin.readline().rstrip("\n")) n int(sys.stdin.readline().rstrip("\n")) int sys.stdin.readline().rstrip("\n") sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip "\n" int(s) for s in sys.stdin.readline().rstrip("\n").split() for s in sys.stdin.readline().rstrip("\n").split() s sys.stdin.readline().rstrip("\n").split() sys.stdin.readline().rstrip("\n").split sys.stdin.readline().rstrip("\n") sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip "\n" split for s in sys.stdin.readline().rstrip("\n").split() int(s) int s l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()] l [int(s) for s in sys.stdin.readline().rstrip("\n").split()] l.sort() l.sort l sort ans = 0 ans 0 for a in range(n):
    for b in range(a+1,n):
        for c in range(b+1,n):
            if l[a] != l[b] and l[b] != l[c] and l[a] != l[c]:
                if l[a] + l[b] > l[c]:
                    ans += 1 a range(n) range n for b in range(a+1,n):
        for c in range(b+1,n):
            if l[a] != l[b] and l[b] != l[c] and l[a] != l[c]:
                if l[a] + l[b] > l[c]:
                    ans += 1 b range(a+1,n) range a+1 a 1 n for c in range(b+1,n):
            if l[a] != l[b] and l[b] != l[c] and l[a] != l[c]:
                if l[a] + l[b] > l[c]:
                    ans += 1 c range(b+1,n) range b+1 b 1 n if l[a] != l[b] and l[b] != l[c] and l[a] != l[c]:
                if l[a] + l[b] > l[c]:
                    ans += 1 l[a] != l[b] and l[b] != l[c] and l[a] != l[c] l[a] != l[b] and l[b] != l[c] l[a] != l[b] l[a] l a l[b] l b l[b] != l[c] l[b] l b l[c] l c l[a] != l[c] l[a] l a l[c] l c if l[a] + l[b] > l[c]:
                    ans += 1 l[a] + l[b] > l[c] l[a] + l[b] l[a] l a l[b] l b l[c] l c ans += 1 ans 1 print(ans) print ans l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()] [int(s) for s in sys.stdin.readline().rstrip("\n").split()] l n = int(sys.stdin.readline().rstrip("\n")) int(sys.stdin.readline().rstrip("\n")) n ans = 0 0 ans ans += 1 1 ans
import sys
n = int(sys.stdin.readline().rstrip("\n"))
l = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
l.sort()
ans = 0
for a in range(n):
    for b in range(a+1,n):
        for c in range(b+1,n):
            if l[a] != l[b] and l[b] != l[c] and l[a] != l[c]:
                if l[a] + l[b] > l[c]:
                    ans += 1
print(ans)