#include <bits/stdc++.h>
using namespace std;
template <class C>
inline bool in_(const typename C::key_type& k, const C& A) {
  return A.find(k) != A.end();
}
inline bool in_(const string& s, const string& S) {
  return S.find(s) != string::npos;
}
const int inf = 1e9;
const int maxn = 1e5 + 5;
const int maxm = 20;
int cnt[maxm][maxm], dp[1 << maxm];
char s[maxn];
int dfs(const int mask, const int m) {
  if (mask + 1 == (1 << m)) return 0;
  int& ans = dp[mask];
  if (-1 == ans) {
    ans = inf;
    int notused = 0;
    for (int i = (0); i < (m); ++i)
      if ((mask & (1 << i)) == 0) notused |= (1 << i);
    int cost = 0;
    for (int i = (0); i < (m); ++i)
      for (int j = (0); j < (m); ++j)
        if (mask & (1 << i) && notused & (1 << j)) cost += cnt[i][j];
    for (int i = (0); i < (m); ++i)
      if ((mask & (1 << i)) == 0)
        ans = min(ans, dfs(mask | (1 << i), m) + cost);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  while (cin >> n >> m >> s) {
    memset(dp, -1, sizeof(dp));
    memset(cnt, 0, sizeof(cnt));
    for (int i = (0); i < (n - 1); ++i) {
      const char a = s[i + 0] - 'a';
      const char b = s[i + 1] - 'a';
      cnt[a][b]++;
      cnt[b][a]++;
    }
    cout << dfs(0, m) << endl;
  }
  return 0;
}
