#include <bits/stdc++.h>
using namespace std;
int n, m, mem[1LL << 22], f[25][25];
string s;
int solve(int msk = 0) {
  if (msk + 1 == (1LL << m)) return 0;
  if (~mem[msk]) return mem[msk];
  mem[msk] = 1e18;
  int pos = 0, t = msk;
  while (t) {
    pos += (t & 1LL);
    t >>= 1LL;
  }
  for (int i = 0; i < m; i++) {
    if ((1LL << i) & msk) continue;
    int add = 0;
    for (int j = 0; j < m; j++) {
      if (i == j) continue;
      if ((1LL << j) & msk)
        add += f[i][j];
      else
        add -= f[i][j];
    }
    mem[msk] = min(mem[msk], add * pos + solve(msk | (1LL << i)));
  }
  return mem[msk];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  memset(mem, -1, sizeof(mem));
  cin >> n >> m >> s;
  for (int i = 1; i < n; i++) {
    f[s[i] - 'a'][s[i - 1] - 'a']++;
    f[s[i - 1] - 'a'][s[i] - 'a']++;
  }
  cout << solve();
  return 0;
}
