#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, S = 1110000, M = 24;
int f[S], c[M][M], n, m;
char s[N];
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  for (int i = 2; i <= n; ++i) {
    c[s[i] - 'a'][s[i - 1] - 'a']++;
    c[s[i - 1] - 'a'][s[i] - 'a']++;
  }
  for (int i = 0; i < m; ++i) {
    c[i][i] = 0;
  }
  memset(f, 0x3f, sizeof(f));
  f[0] = 0;
  for (int s = 0; s < (1 << m); ++s) {
    int p = 1, v = 0;
    for (int i = 0; i < m; ++i) p += (s >> i) & 1;
    for (int i = 0; i < m; ++i) {
      v = 0;
      if (!((s >> i) & 1)) {
        for (int j = 0; j < m; ++j) {
          if ((s >> j) & 1)
            v += c[i][j] * p;
          else
            v -= c[i][j] * p;
        }
        f[s | (1 << i)] = min(f[s | (1 << i)], f[s] + v);
      }
    }
  }
  cout << f[(1 << m) - 1];
  return 0;
}
