#include <bits/stdc++.h>
using namespace std;
int n, m;
string s;
int f[1 << 20];
int g[27][27];
inline int calc(int x) {
  register int res = 0;
  while (x) {
    res++;
    x -= x & -x;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  s.resize(100010);
  scanf("%s", &s[0]);
  s = ' ' + s;
  for (register int i = 2; i <= n; i++) {
    g[s[i - 1] - 'a' + 1][s[i] - 'a' + 1]++;
    g[s[i] - 'a' + 1][s[i - 1] - 'a' + 1]++;
  }
  memset(f, 0x3f, sizeof(f));
  for (int i = 1; i <= m; i++) g[i][i] = 0;
  f[0] = 0;
  int shu = (1 << m);
  for (register int i = 1; i < shu; i++) {
    int pos = calc(i);
    for (register int j = 1; j <= m; j++) {
      if (!(i & (1 << (j - 1)))) continue;
      int s = i ^ (1 << (j - 1));
      int tot = 0;
      for (register int k = 1; k <= m; k++) {
        if (s & (1 << (k - 1)))
          tot += (g[j][k] * pos);
        else
          tot -= (g[j][k] * pos);
      }
      f[i] = min(f[i], f[s] + tot);
    }
  }
  printf("%d", f[shu - 1]);
  return 0;
}
