def ifTriangle(v):
    largest = max(v)
    smallers_sum = 0
    for x in v:
        if not x == largest:
            smallers_sum += x
    if smallers_sum > largest:
        return True
    return False


N = int(input())
L = [int(x) for x in input().split()]
L.sort()
L.reverse()

count = 0
before_i = -1
before_j = -1
before_k = -1
for i in range(N-2):
    for j in range(i+1, N-1):
        if L[j] == L[i]:
            continue
        if L[i]/2 >= L[j]:
            break
        for k in range(j+1, N):
            if L[k] == L[j]:
                continue
            if ifTriangle([L[i], L[j], L[k]]):
                count += 1
print(count) def ifTriangle(v):
    largest = max(v)
    smallers_sum = 0
    for x in v:
        if not x == largest:
            smallers_sum += x
    if smallers_sum > largest:
        return True
    return False ifTriangle largest = max(v) largest max(v) max v smallers_sum = 0 smallers_sum 0 for x in v:
        if not x == largest:
            smallers_sum += x
     x v if not x == largest:
            smallers_sum += x
     not x == largest x == largest x largest smallers_sum += x smallers_sum x if smallers_sum > largest:
        return True
     smallers_sum > largest smallers_sum largest return True True return False False v v N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x L = [int(x) for x in input().split()] L [int(x) for x in input().split()] L.sort() L.sort L sort L.reverse() L.reverse L reverse count = 0 count 0 before_i = -1 before_i -1 before_j = -1 before_j -1 before_k = -1 before_k -1 for i in range(N-2):
    for j in range(i+1, N-1):
        if L[j] == L[i]:
            continue
        if L[i]/2 >= L[j]:
            break
        for k in range(j+1, N):
            if L[k] == L[j]:
                continue
            if ifTriangle([L[i], L[j], L[k]]):
                count += 1 i range(N-2) range N-2 N 2 for j in range(i+1, N-1):
        if L[j] == L[i]:
            continue
        if L[i]/2 >= L[j]:
            break
        for k in range(j+1, N):
            if L[k] == L[j]:
                continue
            if ifTriangle([L[i], L[j], L[k]]):
                count += 1 j range(i+1, N-1) range i+1 i 1 N-1 N 1 if L[j] == L[i]:
            continue
         L[j] == L[i] L[j] L j L[i] L i continue if L[i]/2 >= L[j]:
            break
         L[i]/2 >= L[j] L[i]/2 L[i] L i 2 L[j] L j break for k in range(j+1, N):
            if L[k] == L[j]:
                continue
            if ifTriangle([L[i], L[j], L[k]]):
                count += 1 k range(j+1, N) range j+1 j 1 N if L[k] == L[j]:
                continue
             L[k] == L[j] L[k] L k L[j] L j continue if ifTriangle([L[i], L[j], L[k]]):
                count += 1 ifTriangle([L[i], L[j], L[k]]) ifTriangle [L[i], L[j], L[k]] L[i] L i L[j] L j L[k] L k count += 1 count 1 print(count) print count L = [int(x) for x in input().split()] [int(x) for x in input().split()] L def ifTriangle(v):
    largest = max(v)
    smallers_sum = 0
    for x in v:
        if not x == largest:
            smallers_sum += x
    if smallers_sum > largest:
        return True
    return False def ifTriangle(v):
    largest = max(v)
    smallers_sum = 0
    for x in v:
        if not x == largest:
            smallers_sum += x
    if smallers_sum > largest:
        return True
    return False ifTriangle before_k = -1 -1 before_k count += 1 1 count N = int(input()) int(input()) N count = 0 0 count before_i = -1 -1 before_i before_j = -1 -1 before_j
def ifTriangle(v):
    largest = max(v)
    smallers_sum = 0
    for x in v:
        if not x == largest:
            smallers_sum += x
    if smallers_sum > largest:
        return True
    return False


N = int(input())
L = [int(x) for x in input().split()]
L.sort()
L.reverse()

count = 0
before_i = -1
before_j = -1
before_k = -1
for i in range(N-2):
    for j in range(i+1, N-1):
        if L[j] == L[i]:
            continue
        if L[i]/2 >= L[j]:
            break
        for k in range(j+1, N):
            if L[k] == L[j]:
                continue
            if ifTriangle([L[i], L[j], L[k]]):
                count += 1
print(count)
