#include <bits/stdc++.h>
using namespace std;
const long long sz = (1 << 20) + 1;
const long long maxn = 1e5 + 1;
void re(long long &x) {
  x = 0;
  char ch = getchar();
  bool nf = 0;
  while (ch < '0' || ch > '9') nf |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = ((x << 3) + (x << 1)) + ch - '0', ch = getchar();
  if (nf) x = -x;
}
long long n, m, maxj, siz[sz], t[27][27], dp[sz];
char ss[maxn];
signed main() {
  memset(dp, 0x7f, sizeof(dp));
  re(n), re(m);
  maxj = (1 << m) - 1;
  for (long long i = (0); i <= (maxj); i++) {
    siz[i] = siz[i >> 1] + (i & 1);
  }
  for (long long i = (1); i <= (n); i++) {
    scanf("%c", &ss[i]);
    if (i != 1) {
      t[ss[i] - 'a'][ss[i - 1] - 'a']++;
      t[ss[i - 1] - 'a'][ss[i] - 'a']++;
    }
  }
  for (long long i = (0); i <= (m); i++) {
    t[i][i] = 0;
  }
  dp[0] = 0;
  for (long long u = (0); u <= (maxj); u++) {
    for (long long i = (1); i <= (m); i++) {
      if (u & (1 << (i - 1))) {
        continue;
      }
      long long ret = 0;
      for (long long j = (1); j <= (m); j++) {
        if ((1 << (j - 1)) & u) {
          ret += t[i - 1][j - 1] * siz[u];
        } else {
          ret -= t[i - 1][j - 1] * siz[u];
        }
      }
      dp[u | (1 << (i - 1))] = min(dp[u | (1 << (i - 1))], dp[u] + ret);
    }
  }
  printf("%lld\n", dp[maxj]);
  return 0;
}
