N = int(input())
hen = []

hen = list(int(x) for x in input().split())
hen.sort()
#print(hen)
#hen_u = set(hen)
#print(hen_u)
tri = 0

for a in hen:
    for b in hen:
        if(a == b)or (a > b):
            continue
        for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1

print(tri) N = int(input()) N int(input()) int input() input hen = [] hen [] hen = list(int(x) for x in input().split()) hen list(int(x) for x in input().split()) list int(x) int x hen.sort() hen.sort hen sort tri = 0 tri 0 for a in hen:
    for b in hen:
        if(a == b)or (a > b):
            continue
        for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1 a hen for b in hen:
        if(a == b)or (a > b):
            continue
        for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1 b hen if(a == b)or (a > b):
            continue
         (a == b)or (a > b) a == b a b a > b a b continue for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1 c hen if(a == c)or(b == c) or (a > c) or (b > c):
                continue
             (a == c)or(b == c) or (a > c) or (b > c) (a == c)or(b == c) or (a > c) (a == c)or(b == c) a == c a c b == c b c a > c a c b > c b c continue if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1 (a+b >c)and(b+c >a)and(c+a >b) (a+b >c)and(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 tri += 1 tri 1 print(tri) print tri hen = [] [] hen N = int(input()) int(input()) N hen = list(int(x) for x in input().split()) list(int(x) for x in input().split()) hen tri += 1 1 tri tri = 0 0 tri
N = int(input())
hen = []

hen = list(int(x) for x in input().split())
hen.sort()
#print(hen)
#hen_u = set(hen)
#print(hen_u)
tri = 0

for a in hen:
    for b in hen:
        if(a == b)or (a > b):
            continue
        for c in hen:
            if(a == c)or(b == c) or (a > c) or (b > c):
                continue
            if(a+b >c)and(b+c >a)and(c+a >b):
                tri += 1

print(tri)