#include <bits/stdc++.h>
using namespace std;
const int MAX_M = 20;
const int MAX = 131072;
const int MAX_SETS = (1 << 20) + 1000;
int dp[MAX_SETS];
char password[MAX];
int set_sizes[MAX_SETS];
int consecutive[MAX_M + 1][MAX_M + 1];
int partial_ans[MAX_SETS][MAX_M + 1];
int main() {
  int n, m;
  scanf("%d%d\n", &n, &m);
  fgets(password, MAX, stdin);
  for (int i = 1; i < n; i++) {
    int dist_a = password[i] - 'a';
    int dist_b = password[i - 1] - 'a';
    ++consecutive[dist_a][dist_b];
    ++consecutive[dist_b][dist_a];
  }
  for (int i = 1; i < (1 << m); i++) {
    set_sizes[i] = __builtin_popcount(i);
    int lsb = __builtin_ffs(i) - 1;
    for (int j = 0; j < m; j++) {
      int prev_cost = partial_ans[i ^ (1 << lsb)][j];
      int new_cost = consecutive[j][lsb];
      partial_ans[i][j] = prev_cost + new_cost;
    }
  }
  for (int i = 0; i < (1 << m); ++i) dp[i] = INT_MAX;
  dp[0] = 0;
  for (int i = 0; i < (1 << m); i++) {
    for (int j = 0; j < m; j++) {
      if (!(i & (1 << j))) {
        int position = set_sizes[i];
        int tmp = i | (1 << j);
        int cost_adjustment = partial_ans[((1 << m) - 1) ^ tmp][j];
        int cost = partial_ans[i][j];
        int estimated_cost = cost - cost_adjustment;
        dp[tmp] = min(dp[tmp], dp[i] + position * estimated_cost);
      }
    }
  }
  cout << dp[(1 << m) - 1] << "\n";
  return 0;
}
