public static void main(String[] args) throws FileNotFoundException {
        long start = System.currentTimeMillis();
        Scanner in = new Scanner(new FileInputStream("files/new/triplets/input03.txt"));
        // Scanner in = new Scanner(System.in);
        int c = in.nextInt();
        long[] n = new long[c];
        for (int i = 0; i < c; i++) {
            n[i] = in.nextLong();
        }
        int result = 0;
        for (int i = 0; i < c - 2; i++) {
            if (!done_I.add(n[i])) {
                continue;
            }
            for (int j = i + 1; j < c - 1; j++) {
                if (n[i] < n[j]) {
                    if (!done_J.add(n[j])) {
                        continue;
                    }
                    for (int k = j + 1; k < c; k++) {
                        if (n[j] < n[k]) {
                            if (!done_K.add(n[k])) {
                                continue;
                            }
                            result++;
                            System.out.println(n[i] + "," + n[j] + "," + n[k]);
                        }
                    }
                    done_K.clear();
                }
            }
            done_J.clear();
        }
        System.out.println(result);
        System.out.println("Time = " + (System.currentTimeMillis() - start) + " ms.");
        in.close();
    }