#include <bits/stdc++.h>
using namespace std;
const double pai = acos(-1);
const double eps = 1e-10;
const long long mod = 1e9 + 7;
const int MXN = 1e6 + 5;
int mp[30][30];
char s[MXN];
int dp[(1 << 21)];
int main() {
  int n, m;
  cin >> n >> m;
  scanf("%s", s);
  for (int i = 1; i < n; i++)
    mp[s[i] - 'a'][s[i - 1] - 'a']++, mp[s[i - 1] - 'a'][s[i] - 'a']++;
  for (int i = 0; i <= (1 << m); i++) dp[i] = INT_MAX / 10;
  int NN = (1 << m);
  dp[0] = 0;
  for (int i = 1; i < NN; i++) {
    for (int j = 0; j < m; j++) {
      if (((1 << j) & i) == 0) continue;
      dp[i] = min(dp[i], dp[i - (1 << j)]);
    }
    for (int j = 0; j < m; j++) {
      if (((1 << j) & i) == 0) continue;
      for (int k = 0; k < m; k++) {
        if (((1 << k) & i) > 0) continue;
        dp[i] += mp[j][k];
      }
    }
  }
  cout << dp[(1 << m) - 1];
  return 0;
}
