#include <bits/stdc++.h>
using namespace std;
string s;
int cnt[22][22], dp[(1 << 20) + 7], n, m;
void printmask(int mask) {
  for (int i = 7; i >= 0; i--) {
    if (i % 4 == 3) cout << " ";
    cout << ((bool)(mask & (1 << i)));
  }
  cout << endl;
}
int solve(int mask) {
  if (mask == (1 << m) - 1) return 0;
  int &ret = dp[mask];
  if (ret != -1) return ret;
  int pos = __builtin_popcount(mask) + 1;
  int res = 1000000000;
  for (int i = 0; i < m; i++) {
    if (mask & (1 << i)) continue;
    int op = 0;
    for (int j = 0; j < m; j++) {
      if (j == i) continue;
      if (mask & (1 << j))
        op += cnt[i][j];
      else
        op -= cnt[i][j];
    }
    int g = op * pos + solve(mask | (1 << i));
    res = min(res, g);
  }
  return ret = res;
}
int main() {
  string s;
  cin >> n >> m;
  cin >> s;
  for (int i = 1; i < s.size(); i++)
    cnt[s[i - 1] - 'a'][s[i] - 'a']++, cnt[s[i] - 'a'][s[i - 1] - 'a']++;
  memset(dp, -1, sizeof(dp));
  cout << solve(0) << endl;
}
