n = int(input())
l = list(map(int, input().split()))
r = {l[i]:0 for i in range(n)}
for i in range(n):
    r[l[i]] += 1
t = list(r.items())
ans = 0
for i in range(len(t)-2):
    for j in range(i+1, len(t)-1):
        for k in range(j+1, len(t)):
            y = sum([t[i][0], t[j][0], t[k][0]])
            x = max([t[i][0], t[j][0], t[k][0]])
            if 2*x < y:
                ans += t[i][1] * t[j][1] * t[k][1]
print(ans) n = int(input()) n int(input()) int input() input l = list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split l[i]:0 for i in range(n) for i in range(n) i range(n) range n for i in range(n) l[i] l i 0 r = {l[i]:0 for i in range(n)} r {l[i]:0 for i in range(n)} for i in range(n):
    r[l[i]] += 1 i range(n) range n r[l[i]] += 1 r[l[i]] r l[i] l i 1 t = list(r.items()) t list(r.items()) list r.items() r.items r items ans = 0 ans 0 for i in range(len(t)-2):
    for j in range(i+1, len(t)-1):
        for k in range(j+1, len(t)):
            y = sum([t[i][0], t[j][0], t[k][0]])
            x = max([t[i][0], t[j][0], t[k][0]])
            if 2*x < y:
                ans += t[i][1] * t[j][1] * t[k][1] i range(len(t)-2) range len(t)-2 len(t) len t 2 for j in range(i+1, len(t)-1):
        for k in range(j+1, len(t)):
            y = sum([t[i][0], t[j][0], t[k][0]])
            x = max([t[i][0], t[j][0], t[k][0]])
            if 2*x < y:
                ans += t[i][1] * t[j][1] * t[k][1] j range(i+1, len(t)-1) range i+1 i 1 len(t)-1 len(t) len t 1 for k in range(j+1, len(t)):
            y = sum([t[i][0], t[j][0], t[k][0]])
            x = max([t[i][0], t[j][0], t[k][0]])
            if 2*x < y:
                ans += t[i][1] * t[j][1] * t[k][1] k range(j+1, len(t)) range j+1 j 1 len(t) len t y = sum([t[i][0], t[j][0], t[k][0]]) y sum([t[i][0], t[j][0], t[k][0]]) sum [t[i][0], t[j][0], t[k][0]] t[i][0] [i] t i 0 t[j][0] [j] t j 0 t[k][0] [k] t k 0 x = max([t[i][0], t[j][0], t[k][0]]) x max([t[i][0], t[j][0], t[k][0]]) max [t[i][0], t[j][0], t[k][0]] t[i][0] [i] t i 0 t[j][0] [j] t j 0 t[k][0] [k] t k 0 if 2*x < y:
                ans += t[i][1] * t[j][1] * t[k][1] 2*x < y 2*x 2 x y ans += t[i][1] * t[j][1] * t[k][1] ans t[i][1] * t[j][1] * t[k][1] t[i][1] * t[j][1] t[i][1] [i] t i 1 t[j][1] [j] t j 1 t[k][1] [k] t k 1 print(ans) print ans ans = 0 0 ans t = list(r.items()) list(r.items()) t n = int(input()) int(input()) n y = sum([t[i][0], t[j][0], t[k][0]]) sum([t[i][0], t[j][0], t[k][0]]) y l = list(map(int, input().split())) list(map(int, input().split())) l r = {l[i]:0 for i in range(n)} {l[i]:0 for i in range(n)} r ans += t[i][1] * t[j][1] * t[k][1] t[i][1] * t[j][1] * t[k][1] ans x = max([t[i][0], t[j][0], t[k][0]]) max([t[i][0], t[j][0], t[k][0]]) x
n = int(input())
l = list(map(int, input().split()))
r = {l[i]:0 for i in range(n)}
for i in range(n):
    r[l[i]] += 1
t = list(r.items())
ans = 0
for i in range(len(t)-2):
    for j in range(i+1, len(t)-1):
        for k in range(j+1, len(t)):
            y = sum([t[i][0], t[j][0], t[k][0]])
            x = max([t[i][0], t[j][0], t[k][0]])
            if 2*x < y:
                ans += t[i][1] * t[j][1] * t[k][1]
print(ans)