function main(input) {
  let args = input.split('\n')[1].split(' ');
  let ans = 0;
  let ansList = [];
  for (let i = 0;i < args.length;i++) {
    for (let j = i + 1;j < args.length;j++) {
      for (let k = j + 1;k < args.length;k++) {
        if (
          ansList.indexOf([args[i], args[j], args[k]]) === -1 &&
          args[i] !== args[j] &&
          args[i] !== args[k] &&
          args[j] !== args[k]
        ) {
          console.log([args[i], args[j], args[k]]);
          ans++;
          ansList.push([args[i], args[j], args[k]]);
          break;
        }
      }
    }
  }
  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))