N = int(input())
L = [int(i)for i in input().split()]
ans = 0
L.sort(reverse=True)
for i,l in enumerate(L[:-2]):
    for j,l2 in enumerate(L[i+1:N-1]):
        for l3 in L[i+j+2:]:
            if l < l2 + l3:
                if l > l2 > l3:
                    ans += 1
            else:
                break
print(ans) N = int(input()) N int(input()) int input() input int(i)for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i L = [int(i)for i in input().split()] L [int(i)for i in input().split()] ans = 0 ans 0 L.sort(reverse=True) L.sort L sort reverse=True reverse True for i,l in enumerate(L[:-2]):
    for j,l2 in enumerate(L[i+1:N-1]):
        for l3 in L[i+j+2:]:
            if l < l2 + l3:
                if l > l2 > l3:
                    ans += 1
            else:
                break i l enumerate(L[:-2]) enumerate L[:-2] L :-2 -2 for j,l2 in enumerate(L[i+1:N-1]):
        for l3 in L[i+j+2:]:
            if l < l2 + l3:
                if l > l2 > l3:
                    ans += 1
            else:
                break j l2 enumerate(L[i+1:N-1]) enumerate L[i+1:N-1] L i+1:N-1 i+1 i 1 N-1 N 1 for l3 in L[i+j+2:]:
            if l < l2 + l3:
                if l > l2 > l3:
                    ans += 1
            else:
                break l3 L[i+j+2:] L i+j+2: i+j+2 i+j i j 2 if l < l2 + l3:
                if l > l2 > l3:
                    ans += 1
            else:
                break l < l2 + l3 l l2 + l3 l2 l3 if l > l2 > l3:
                    ans += 1
             l > l2 > l3 l > l2 l l2 l3 ans += 1 ans 1 break print(ans) print ans ans = 0 0 ans L = [int(i)for i in input().split()] [int(i)for i in input().split()] L N = int(input()) int(input()) N ans += 1 1 ans
N = int(input())
L = [int(i)for i in input().split()]
ans = 0
L.sort(reverse=True)
for i,l in enumerate(L[:-2]):
    for j,l2 in enumerate(L[i+1:N-1]):
        for l3 in L[i+j+2:]:
            if l < l2 + l3:
                if l > l2 > l3:
                    ans += 1
            else:
                break
print(ans)