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