#include <bits/stdc++.h>
using namespace std;
int cnt[21][1100009];
int dp[1100009];
int cal[21][1100009];
inline int lowbit(int a) { return a & (-a); }
inline int ones(int a) {
  int ret = 0;
  while (a > 0) {
    ret++;
    a -= lowbit(a);
  }
  return ret;
}
int main() {
  int N, M, i, j, k, T, now;
  string s;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  cin >> s;
  for (i = 0; i < N - 1; i++) {
    if (s[i] != s[i + 1]) {
      cnt[s[i] - 'a'][1 << (s[i + 1] - 'a')]++;
      cnt[s[i + 1] - 'a'][1 << (s[i] - 'a')]++;
    }
  }
  for (i = 0; i < M; i++) {
    cal[i][0] = 0;
    for (j = 1; j < (1 << M); j++) {
      if ((1 << i) & j) continue;
      cal[i][j] = cal[i][j - lowbit(j)] + cnt[i][lowbit(j)];
    }
  }
  dp[0] = 0;
  for (i = 1; i < (1 << M); i++) {
    dp[i] = 1000000009;
    now = ones(i);
    for (j = 0; j < M; j++) {
      if (i & (1 << j)) {
        dp[i] = min(dp[i], dp[i ^ (1 << j)] + cal[j][i ^ (1 << j)] * (now) +
                               cal[j][((1 << M) - 1) ^ i] * (0 - now));
      }
    }
  }
  cout << dp[(1 << M) - 1] << '\n';
}
