n = int(input())
l = list(sorted(map(int, input().split())))
x = 0
if n >= 3:
    for k in range(n - 2):
        for j in range(k + 1):
            for i in range(j + 1):
                if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1
print(x) n = int(input()) n int(input()) int input() input l = list(sorted(map(int, input().split()))) l list(sorted(map(int, input().split()))) list sorted(map(int, input().split())) sorted map(int, input().split()) map int input().split() ().split () input split x = 0 x 0 if n >= 3:
    for k in range(n - 2):
        for j in range(k + 1):
            for i in range(j + 1):
                if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1 n >= 3 n 3 for k in range(n - 2):
        for j in range(k + 1):
            for i in range(j + 1):
                if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1 k range(n - 2) range n - 2 n 2 for j in range(k + 1):
            for i in range(j + 1):
                if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1 j range(k + 1) range k + 1 k 1 for i in range(j + 1):
                if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1 i range(j + 1) range j + 1 j 1 if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1 l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2] l[i] < l[j + 1] < l[k + 2] l[i] < l[j + 1] l[i] l i l[j + 1] l j + 1 j 1 l[k + 2] l k + 2 k 2 l[i] + l[j + 1] > l[k + 2] l[i] + l[j + 1] l[i] l i l[j + 1] l j + 1 j 1 l[k + 2] l k + 2 k 2 x += 1 x 1 print(x) print x l = list(sorted(map(int, input().split()))) list(sorted(map(int, input().split()))) l x = 0 0 x x += 1 1 x n = int(input()) int(input()) n
n = int(input())
l = list(sorted(map(int, input().split())))
x = 0
if n >= 3:
    for k in range(n - 2):
        for j in range(k + 1):
            for i in range(j + 1):
                if l[i] < l[j + 1] < l[k + 2] and l[i] + l[j + 1] > l[k + 2]:
                    x += 1
print(x)