from itertools import combinations

N = int(input())
L = sorted(list(map(int, input().split())))

ans = 0

for a,b,c in combinations(L, 3):
    ans += a < b < c < a+b

print(ans) from itertools import combinations N = int(input()) N int(input()) int input() input L = sorted(list(map(int, input().split()))) L sorted(list(map(int, input().split()))) sorted 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 += a < b < c < a+b a b c combinations(L, 3) combinations L 3 ans += a < b < c < a+b ans a < b < c < a+b a < b < c a < b a b c a+b a b print(ans) print ans ans = 0 0 ans N = int(input()) int(input()) N ans += a < b < c < a+b a < b < c < a+b ans L = sorted(list(map(int, input().split()))) sorted(list(map(int, input().split()))) L
from itertools import combinations

N = int(input())
L = sorted(list(map(int, input().split())))

ans = 0

for a,b,c in combinations(L, 3):
    ans += a < b < c < a+b

print(ans)