n = int(input())
l = [int(x) for x in input().split()]

if(n<3):
    print(0)
    exit()
l.sort(reverse=True)
ln = len(l)
cnt = 0
for i in range(ln):
    for j in range(i+1,ln):
        for k in range(j+1,ln):
            a,b,c = l[i],l[j],l[k]
            if(a==b or b==c or a==c):
                continue
            if(a<(b+c)):
                cnt += 1

print(cnt) n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x l = [int(x) for x in input().split()] l [int(x) for x in input().split()] if(n<3):
    print(0)
    exit() n<3 n 3 print(0) print 0 exit() exit l.sort(reverse=True) l.sort l sort reverse=True reverse True ln = len(l) ln len(l) len l cnt = 0 cnt 0 for i in range(ln):
    for j in range(i+1,ln):
        for k in range(j+1,ln):
            a,b,c = l[i],l[j],l[k]
            if(a==b or b==c or a==c):
                continue
            if(a<(b+c)):
                cnt += 1 i range(ln) range ln for j in range(i+1,ln):
        for k in range(j+1,ln):
            a,b,c = l[i],l[j],l[k]
            if(a==b or b==c or a==c):
                continue
            if(a<(b+c)):
                cnt += 1 j range(i+1,ln) range i+1 i 1 ln for k in range(j+1,ln):
            a,b,c = l[i],l[j],l[k]
            if(a==b or b==c or a==c):
                continue
            if(a<(b+c)):
                cnt += 1 k range(j+1,ln) range j+1 j 1 ln a,b,c = l[i],l[j],l[k] a l[i] l i b l[j] l j c l[k] l k if(a==b or b==c or a==c):
                continue
             a==b or b==c or a==c a==b or b==c a==b a b b==c b c a==c a c continue if(a<(b+c)):
                cnt += 1 a<(b+c) a b+c b c cnt += 1 cnt 1 print(cnt) print cnt cnt = 0 0 cnt l = [int(x) for x in input().split()] [int(x) for x in input().split()] l a,b,c = l[i],l[j],l[k] l[i] a cnt += 1 1 cnt b,c = l[i],l[j],l[k] l[j] b c = l[i],l[j],l[k] l[k] c ln = len(l) len(l) ln n = int(input()) int(input()) n
n = int(input())
l = [int(x) for x in input().split()]

if(n<3):
    print(0)
    exit()
l.sort(reverse=True)
ln = len(l)
cnt = 0
for i in range(ln):
    for j in range(i+1,ln):
        for k in range(j+1,ln):
            a,b,c = l[i],l[j],l[k]
            if(a==b or b==c or a==c):
                continue
            if(a<(b+c)):
                cnt += 1

print(cnt)