#include <bits/stdc++.h>
using namespace std;
int n, m, pos, sum;
int f[1200010], cnt[25][25];
char s[100010];
int main() {
  memset(f, 0x7f, sizeof(f));
  f[0] = 0;
  scanf("%d%d", &n, &m);
  cin >> s + 1;
  for (int i = 1; i < n; i++) {
    cnt[s[i] - 'a'][s[i + 1] - 'a']++;
    cnt[s[i + 1] - 'a'][s[i] - 'a']++;
  }
  for (int i = 0; i < m; i++) cnt[i][i] = 0;
  for (int use = 0; use < (1 << m) - 1; use++) {
    pos = 0;
    for (int i = 0; i < m; i++)
      if (use & (1 << i)) pos++;
    for (int i = 0; i < m; i++)
      if (!(use & (1 << i))) {
        sum = 0;
        for (int j = 0; j < m; j++) {
          if (use & (1 << j))
            sum += cnt[i][j] * pos;
          else
            sum -= cnt[i][j] * pos;
        }
        f[use | (1 << i)] = min(f[use | (1 << i)], f[use] + sum);
      }
  }
  printf("%d", f[(1 << m) - 1]);
}
