#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int inf = 1e9 + 5;
int n, m;
string s;
int koji[20][20];
int dp[(1 << 20)];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m >> s;
  for (int i = 1; i < n; i++) {
    koji[s[i] - 'a'][s[i - 1] - 'a']++;
    koji[s[i - 1] - 'a'][s[i] - 'a']++;
  }
  for (int mask = 0; mask < (1 << m); mask++) dp[mask] = inf;
  dp[0] = 0;
  for (int mask = 0; mask < (1 << m); mask++) {
    int kol = 0;
    for (int i = 0; i < m; i++) {
      if (mask & (1 << i)) {
        for (int j = 0; j < m; j++) {
          if (!(mask & (1 << j))) kol += koji[i][j];
        }
      }
    }
    for (int i = 0; i < m; i++) {
      if (!(mask & (1 << i)))
        dp[mask | (1 << i)] = min(dp[mask | (1 << i)], dp[mask] + kol);
    }
  }
  cout << dp[(1 << m) - 1] << endl;
  return 0;
}
