#include <bits/stdc++.h>
using namespace std;
int cnt[25][25];
int memo[1048576];
int N, M, mx;
long long ans;
string word;
long long dp(int bitmask) {
  if (bitmask == mx) return 0;
  if (memo[bitmask] != -1) return memo[bitmask];
  long long res = 0;
  long long tres = LONG_MAX;
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < M; j++) {
      if (bitmask & (1 << i) && !(bitmask & (1 << j))) {
        res += cnt[i][j] + cnt[j][i];
      }
    }
  }
  int tmp = ~bitmask & mx;
  while (tmp) {
    int pos = tmp & -tmp;
    tres = min(tres, dp(bitmask | pos));
    tmp -= pos;
  }
  return memo[bitmask] = res + tres;
}
int main() {
  memset(memo, -1, sizeof memo);
  ios_base::sync_with_stdio(0);
  cin >> N >> M;
  mx = (1 << M) - 1;
  char last, now;
  cin >> last;
  for (int i = 1; i < N; i++) {
    cin >> now;
    cnt[last - 'a'][now - 'a']++;
    last = now;
  }
  cout << dp(0) << "\n";
}
