from itertools import combinations
n = int(input())
L = list(map(int,input().split()))
ans = 0
for x in combinations(L,3):
    a,b,c = map(int,x)
    if a == b or b == c or c == a:
        continue
    ans += (2*max(a,b,c) < a+b+c)
print(ans) from itertools import combinations 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 ans = 0 ans 0 for x in combinations(L,3):
    a,b,c = map(int,x)
    if a == b or b == c or c == a:
        continue
    ans += (2*max(a,b,c) < a+b+c) x combinations(L,3) combinations L 3 a,b,c = map(int,x) a map(int,x) map int x b c if a == b or b == c or c == a:
        continue
     a == b or b == c or c == a a == b or b == c a == b a b b == c b c c == a c a continue ans += (2*max(a,b,c) < a+b+c) ans 2*max(a,b,c) < a+b+c 2*max(a,b,c) 2 max(a,b,c) max a b c a+b+c a+b a b c print(ans) print ans L = list(map(int,input().split())) list(map(int,input().split())) L b,c = map(int,x) map(int,x) b n = int(input()) int(input()) n a,b,c = map(int,x) map(int,x) a c = map(int,x) map(int,x) c ans += (2*max(a,b,c) < a+b+c) 2*max(a,b,c) < a+b+c ans ans = 0 0 ans
from itertools import combinations
n = int(input())
L = list(map(int,input().split()))
ans = 0
for x in combinations(L,3):
    a,b,c = map(int,x)
    if a == b or b == c or c == a:
        continue
    ans += (2*max(a,b,c) < a+b+c)
print(ans)