#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 21) + 3;
int dp[N], g[20][20], c, n, m, i, j, k;
char s[N];
int main() {
  for (scanf("%d%d%s", &n, &m, s + 1), i = 2; i <= n; ++i)
    g[s[i] - 'a'][s[i - 1] - 'a'] = ++g[s[i - 1] - 'a'][s[i] - 'a'];
  for (i = 1; i < (1 << m); ++i) {
    dp[i] = 2e9;
    for (j = c = 0; j < m; ++j)
      for (k = j + 1; k < m; ++k)
        if ((i >> j & 1) ^ (i >> k & 1)) c += g[j][k];
    for (j = 0; j < m; ++j)
      if (i >> j & 1) dp[i] = min(dp[i], dp[i ^ (1 << j)] + c);
  }
  printf("%d\n", dp[(1 << m) - 1]);
}
