#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int SUM = 0, ff = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    SUM = (SUM << 3) + (SUM << 1) + (ch ^ 48);
    ch = getchar();
  }
  return SUM * ff;
}
const int N = 100010;
const int M = 21;
const int inf = 0x3f3f3f3f;
int dp[1 << M];
char str[N];
int cnt[M][M];
int n, m;
int main() {
  n = read(), m = read();
  scanf("%s", str + 1);
  for (int i = 1; i < n; i++) {
    cnt[str[i] - 'a'][str[i + 1] - 'a']++;
    cnt[str[i + 1] - 'a'][str[i] - 'a']++;
  }
  for (int i = 0; i < m; i++) cnt[i][i] = 0;
  memset(dp, inf, sizeof(dp));
  dp[0] = 0;
  for (int mask = 0; mask < (1 << m); mask++) {
    int one = 0, x = mask;
    while (x) {
      one++;
      x -= x & -x;
    }
    for (int i = 0; i < m; i++)
      if (((mask >> i) & 1) == 0) {
        int sum = 0;
        for (int j = 0; j < m; j++)
          if ((mask >> j) & 1)
            sum += cnt[i][j] * one;
          else
            sum -= cnt[j][i] * one;
        dp[mask | (1 << i)] = min(dp[mask | (1 << i)], dp[mask] + sum);
      }
  }
  printf("%d\n", dp[(1 << m) - 1]);
  return 0;
}
