from collections import defaultdict

n = int(input())
l_list = [int(x) for x in input().split()]

d = defaultdict(int)
for l in l_list:
    d[l] += 1

n = len(d)
l_list = sorted(d.keys())
ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            a, b, c = l_list[i], l_list[j], l_list[k]
            if a + b <= c:
                continue
            ans += d[a] * d[b] * d[c]
print(ans) from collections import defaultdict 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_list = [int(x) for x in input().split()] l_list [int(x) for x in input().split()] d = defaultdict(int) d defaultdict(int) defaultdict int for l in l_list:
    d[l] += 1 l l_list d[l] += 1 d[l] d l 1 n = len(d) n len(d) len d l_list = sorted(d.keys()) l_list sorted(d.keys()) sorted d.keys() d.keys d keys ans = 0 ans 0 for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            a, b, c = l_list[i], l_list[j], l_list[k]
            if a + b <= c:
                continue
            ans += d[a] * d[b] * d[c] i range(n - 2) range n - 2 n 2 for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            a, b, c = l_list[i], l_list[j], l_list[k]
            if a + b <= c:
                continue
            ans += d[a] * d[b] * d[c] j range(i + 1, n - 1) range i + 1 i 1 n - 1 n 1 for k in range(j + 1, n):
            a, b, c = l_list[i], l_list[j], l_list[k]
            if a + b <= c:
                continue
            ans += d[a] * d[b] * d[c] k range(j + 1, n) range j + 1 j 1 n a, b, c = l_list[i], l_list[j], l_list[k] a l_list[i] l_list i b l_list[j] l_list j c l_list[k] l_list k if a + b <= c:
                continue
             a + b <= c a + b a b c continue ans += d[a] * d[b] * d[c] ans d[a] * d[b] * d[c] d[a] * d[b] d[a] d a d[b] d b d[c] d c print(ans) print ans l_list = [int(x) for x in input().split()] [int(x) for x in input().split()] l_list n = len(d) len(d) n n = int(input()) int(input()) n d = defaultdict(int) defaultdict(int) d a, b, c = l_list[i], l_list[j], l_list[k] l_list[i] a b, c = l_list[i], l_list[j], l_list[k] l_list[j] b l_list = sorted(d.keys()) sorted(d.keys()) l_list c = l_list[i], l_list[j], l_list[k] l_list[k] c ans = 0 0 ans ans += d[a] * d[b] * d[c] d[a] * d[b] * d[c] ans
from collections import defaultdict

n = int(input())
l_list = [int(x) for x in input().split()]

d = defaultdict(int)
for l in l_list:
    d[l] += 1

n = len(d)
l_list = sorted(d.keys())
ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            a, b, c = l_list[i], l_list[j], l_list[k]
            if a + b <= c:
                continue
            ans += d[a] * d[b] * d[c]
print(ans)