from itertools import*
n=input()
l = map(int,input().split())
ans = 0
for a, b, c in combinations(l, 3):
    if a != b != c != a and a + b > c and b + c > a and c + a > b:
        ans += 1
print(ans) from itertools import* n=input() n input() input l = map(int,input().split()) l map(int,input().split()) map int input().split() ().split () input split ans = 0 ans 0 for a, b, c in combinations(l, 3):
    if a != b != c != a and a + b > c and b + c > a and c + a > b:
        ans += 1 a b c combinations(l, 3) combinations l 3 if a != b != c != a and a + b > c and b + c > a and c + a > b:
        ans += 1 a != b != c != a and a + b > c and b + c > a and c + a > b a != b != c != a and a + b > c and b + c > a a != b != c != a and a + b > c a != b != c != a a != b != c a != b a b c a a + b > c a + b a b c b + c > a b + c b c a c + a > b c + a c a b ans += 1 ans 1 print(ans) print ans n=input() input() n ans += 1 1 ans ans = 0 0 ans l = map(int,input().split()) map(int,input().split()) l
from itertools import*
n=input()
l = map(int,input().split())
ans = 0
for a, b, c in combinations(l, 3):
    if a != b != c != a and a + b > c and b + c > a and c + a > b:
        ans += 1
print(ans)