#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')


def solve(N: int, L: "List[int]"):
    L.sort()
    return sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, L)}')


if __name__ == '__main__':
    main() from typing import * import collections collections import functools as fts functools import itertools as its itertools import math math import sys sys INF = float('inf') INF float('inf') float 'inf' def solve(N: int, L: "List[int]"):
    L.sort()
    return sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N)) solve L.sort() L.sort L sort return sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N)) sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N)) sum L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] L[i] not in [L[j], L[k]] and L[j] != L[k] L[i] not in [L[j], L[k]] L[i] L i [L[j], L[k]] L[j] L j L[k] L k L[j] != L[k] L[j] L j L[k] L k L[i] + L[j] > L[k] L[i] + L[j] L[i] L i L[j] L j L[k] L k N: int N L: "List[int]" L def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, L)}') main sys.setrecursionlimit(10 ** 6) sys.setrecursionlimit sys setrecursionlimit 10 ** 6 10 6 def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens N = int(next(tokens)) N int(next(tokens)) int next(tokens) next tokens int(next(tokens)) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) int(next(tokens)) int next(tokens) next tokens L = [int(next(tokens)) for _ in range(N)] L [int(next(tokens)) for _ in range(N)] print(f'{solve(N, L)}') print f'{solve(N, L)}' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, L)}') def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, L)}') main def solve(N: int, L: "List[int]"):
    L.sort()
    return sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N)) def solve(N: int, L: "List[int]"):
    L.sort()
    return sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N)) solve INF = float('inf') float('inf') INF
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')


def solve(N: int, L: "List[int]"):
    L.sort()
    return sum(L[i] not in [L[j], L[k]] and L[j] != L[k] and L[i] + L[j] > L[k] for i in range(N) for j in range(i+1, N) for k in range(j+1, N))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(f'{solve(N, L)}')


if __name__ == '__main__':
    main()
