#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10 + 2e6;
const long long oo = 1 + 1e18, mod = 7 + 1e9;
int n, m, dp[MAXN], cnt[30][30];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> m >> s;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    cnt[s[i] - 'a'][s[i - 1] - 'a']++;
    cnt[s[i - 1] - 'a'][s[i] - 'a']++;
  }
  memset(dp, 0x3f, sizeof dp);
  dp[0] = 0;
  for (int mask = 0; mask < (1 << m); mask++) {
    int pos = __builtin_popcount(mask) + 1;
    for (int c = 0; c < m; c++) {
      if (mask & (1 << c)) continue;
      int delta = 0;
      for (int ch = 0; ch < m; ch++) {
        if (ch == c) continue;
        if (mask & (1 << ch))
          delta += pos * cnt[c][ch];
        else
          delta -= pos * cnt[ch][c];
      }
      int nextmask = mask | (1 << c);
      dp[nextmask] = min(dp[nextmask], dp[mask] + delta);
    }
  }
  cout << dp[(1 << m) - 1];
  return 0;
}
