function Main(input) {
  input = input.trim().split("\n");
  var N = parseInt(input[0], 10);
  var S = input[1].split("");

  var comb = [];
  var total = 0;
  function CombArrC(arr, num, id, n, m) {
    //n<=mは満たす必要あり
    if (n == 1) {
      for (var i = 1; i <= m; i++) {
        result.push(i);
      }
      return;
    }
    if (id == 0) {
      nownum = num;
    }
    arr.push(num);
    if (id < n - 1) {
      //組み合わせを作る
      if (m == 2) m++;
      for (var j = num + 1; j <= m - 1 + id; j++) {
        var rep = CombArrC(arr.concat(), j, id + 1, n, m);
      }
    } else {
      result.push(arr);
      return;
    }
    num = nownum + 1;
    if (num >= m) return;
    arr = [];
    CombArrC(arr.concat(), num, 0, n, m);
  }
  var ar = []; //初期配列用
  var result = []; //結果用
  CombArrC(ar.concat(), 1, 0, 3, N);
  for (var i = 0; i < result.length; i++) {
    var str = S[result[i][0] - 1] + S[result[i][1] - 1] + S[result[i][2] - 1];
    comb[i] = str;
  }
  comb = comb.filter((n, i) => {
    return comb.indexOf(n) === i;
  });
  console.log(comb.length);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
