#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const int mod = 1e9 + 7;
const int M = (1 << 20) + 2;
inline int bigmod(int B, int P) {
  int R = 1;
  while (P > 0) {
    if (P & 1) {
      R = (R * B) % mod;
    }
    P >>= 1;
    B = (B * B) % mod;
  }
  return R;
}
int n, m;
int cnt[21][21];
int dp[M];
int magic(int msk) {
  if (msk + 1 == (1 << m)) return 0;
  int &ret = dp[msk];
  if (ret != (-1)) return ret;
  ret = inf;
  int one = __builtin_popcount(msk);
  for (int i = 0; i <= m - 1; i++) {
    if (msk >> i & 1) continue;
    int cost = magic(msk | (1 << i));
    for (int j = 0; j <= m - 1; j++) {
      if (i == j) continue;
      if (msk >> j & 1) {
        cost += (cnt[i][j] * one);
      } else {
        cost -= (cnt[i][j] * one);
      }
    }
    ret = min(ret, cost);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(dp, -1, sizeof dp);
  cin >> n >> m;
  string s;
  cin >> s;
  for (int i = 0; i <= n - 2; i++) {
    cnt[s[i] - 'a'][s[i + 1] - 'a']++;
    cnt[s[i + 1] - 'a'][s[i] - 'a']++;
  }
  cout << magic(0) << "\n";
  return 0;
}
