#include <bits/stdc++.h>
using namespace std;
int dp[1 << 20], cnt[20][20];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  string s;
  cin >> n >> m >> s;
  for (int i = 1; i < n; i++) {
    int a = s[i] - 'a', b = s[i - 1] - 'a';
    cnt[a][b]++;
    cnt[b][a]++;
  }
  memset(dp, 0x3f, sizeof dp);
  dp[0] = 0;
  for (int i = 0; i < (1 << m); i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      if ((i >> j & 1)) {
        for (int k = 0; k < m; k++) {
          if (!(i >> k & 1)) sum += cnt[j][k];
        }
      }
    }
    for (int j = 0; j < m; j++)
      if (i >> j & 1) dp[i] = min(dp[i], dp[i ^ (1 << j)] + sum);
  }
  cout << dp[(1 << m) - 1] << "\n";
  return 0;
}
