#include <bits/stdc++.h>
using namespace std;
char st[100005];
int w[22][22];
int m;
long long dp[1 << 20];
int main() {
  srand(time(NULL));
  int n;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%s", st);
  for (int i = 0; i < n; i++) {
    if (i && st[i] != st[i - 1]) {
      int a = st[i] - 'a';
      int b = st[i - 1] - 'a';
      if (a > b) swap(a, b);
      w[a][b]++;
      w[b][a]++;
    }
  }
  dp[(1 << m) - 1] = 0;
  int one[m], zero[m];
  for (int mask = (1 << m) - 2; mask >= 0; mask--) {
    long long ret = (1ll << 60);
    int o = 0, z = 0;
    for (int i = 0; i < m; i++)
      if (mask & (1 << i))
        one[o++] = i;
      else
        zero[z++] = i;
    long long all = 0;
    for (int j = 0; j < o; j++) {
      for (int k = 0; k < z; k++) {
        all += w[min(one[j], zero[k])][max(one[j], zero[k])];
      }
    }
    for (int i = 0; i < m; i++)
      if (mask & (1 << i))
        ;
      else {
        long long nw = all;
        ret = min(ret, nw + dp[(mask | (1 << i))]);
      }
    dp[mask] = ret;
  }
  printf("%lld\n", dp[0]);
  return 0;
}
