#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int N = 1e5 + 5;
int mat[25][25];
int n, m;
ll dp[1 << 21];
ll f(int mask, ll sum = 0) {
  if (__builtin_popcount(mask) == 0) return 0;
  ll &ret = dp[mask];
  if (ret != -1) return ret;
  ret = 1e9;
  ll aux = sum;
  int mm = mask;
  while (mm) {
    int x = mm & -(mm);
    int i = 31 - __builtin_clz(x);
    mm -= x;
    sum = aux;
    for (int j = 0; j < m; j++) {
      if (mask & (1 << j)) {
        sum += mat[i][j];
      } else {
        sum -= mat[i][j];
      }
    }
    ret = min(ret, f(mask & ~(1 << i), sum) + aux);
  }
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d %d", &n, &m);
  char s[N];
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    s[i] -= 'a';
  }
  for (int i = 1; i < n; i++) {
    if (s[i] != s[i - 1]) {
      mat[s[i]][s[i - 1]]++;
      mat[s[i - 1]][s[i]]++;
    }
  }
  printf("%lld\n", f((1 << m) - 1, 0));
  return 0;
}
