#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 1e5 + 7, M = 20;
int n, m, cnt[M][M];
int pos[(1 << M) + 7], f[(1 << M) + 7], g[M][(1 << M) + 7], h[(1 << M) + 7];
char s[N];
int main() {
  n = read(), m = read();
  scanf("%s", s + 1);
  for (int i = 1; i < n; i++)
    cnt[s[i] - 'a'][s[i + 1] - 'a']++, cnt[s[i + 1] - 'a'][s[i] - 'a']++;
  for (int i = 0; i < m; i++) pos[1 << i] = i;
  memset(f, 0x3f, sizeof(f));
  int mx = (1 << m) - 1;
  f[0] = 0;
  for (int p = 0; p < m; p++)
    for (int o = 1; o < mx; o++) {
      if (o & (1 << p)) continue;
      g[p][o] = g[p][o - (o & -o)] + cnt[p][pos[o & -o]];
    }
  for (int o = 0; o < mx; o++)
    for (int p = 0; p < m; p++)
      if (o & (1 << p)) h[o] += g[p][mx ^ o];
  for (int o = 0; o < mx; o++)
    for (int p = 0; p < m; p++) {
      if (o & (1 << p)) continue;
      f[o ^ (1 << p)] = min(f[o ^ (1 << p)], f[o] + h[o]);
    }
  printf("%d\n", f[mx]);
  return 0;
}
