#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000;
int f[1 << 22];
int n, g[30][30], m;
char s[maxn];
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  for (int i = 0; i < n - 1; ++i) {
    g[s[i] - 'a'][s[i + 1] - 'a']++;
    g[s[i + 1] - 'a'][s[i] - 'a']++;
  }
  for (int i = 1; i < (1 << m); ++i) {
    f[i] = 0x7f7f7f7f;
    int cc = 0;
    for (int j = 0; j < m; ++j) {
      for (int k = j + 1; k < m; ++k) {
        if ((i >> j & 1) ^ (i >> k & 1)) cc += g[j][k];
      }
    }
    for (int j = 0; j < m; ++j) {
      if (i & (1 << j)) f[i] = min(f[i], f[i ^ (1 << j)] + cc);
    }
  }
  printf("%d\n", f[(1 << m) - 1]);
}
