#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, m, cnt[25][25];
int d[1 << 21][25], dp[1 << 21];
char s[maxn];
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  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 = 1; i < 1 << m; i++) {
    for (int j = 0; j < m; j++) {
      d[i][j] = d[i & (i - 1)][j] + cnt[j][__builtin_ffs(i) - 1];
    }
  }
  memset(dp, 0x3f, sizeof(dp));
  dp[0] = 0;
  for (int i = 1; i < 1 << m; i++) {
    for (int j = 0; j < m; j++) {
      if (((1 << j) & i) == 0) continue;
      int s = i - (1 << j);
      int pos = __builtin_popcount(i);
      dp[i] = min(dp[i], dp[s] + pos * (d[s][j] - d[((1 << m) - 1) ^ i][j]));
    }
  }
  printf("%d\n", dp[(1 << m) - 1]);
}
