#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxm = 22;
const int maxn = 1e5 + 7;
char inp[maxn];
int cnt[maxm][maxm];
long long dp[(1 << 20)];
int n, m;
int main() {
  cin >> n >> m;
  scanf("%s", inp);
  for (int i = 1; i < n; i++) {
    if (inp[i] == inp[i - 1]) continue;
    cnt[inp[i] - 'a'][inp[i - 1] - 'a']++;
    cnt[inp[i - 1] - 'a'][inp[i] - 'a']++;
  }
  int end = (1 << m) - 1;
  memset(dp, INF, sizeof(dp));
  dp[0] = 0;
  for (int i = 0; i < end; i++) {
    int num = 0, now = i;
    while (now) {
      now -= now & -now;
      num++;
    }
    for (int j = 0; j < m; j++) {
      if (!(i & (1 << j))) {
        long long sto = dp[i];
        for (int k = 0; k < m; k++) {
          if (i & (1 << k)) {
            sto += (long long)cnt[j][k] * num;
          } else
            sto -= (long long)cnt[j][k] * num;
        }
        dp[i | (1 << j)] = min(dp[i | (1 << j)], sto);
      }
    }
  }
  cout << dp[end] << endl;
  return 0;
}
