#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  string s;
  cin >> n >> m >> s;
  vector<vector<int>> cant(m, vector<int>(m, 0));
  for (int i = 1; i < n; ++i) {
    ++cant[s[i] - 'a'][s[i - 1] - 'a'];
    ++cant[s[i - 1] - 'a'][s[i] - 'a'];
  }
  int t = 1 << m;
  vector<vector<int>> sum(t, vector<int>(m, 0));
  for (int msk = 1; msk < t; ++msk) {
    int b = __builtin_ffs(msk) - 1;
    for (int i = 0; i < m; ++i) {
      sum[msk][i] = sum[msk ^ (1 << b)][i] + cant[b][i];
    }
  }
  int oo = 2 * 1e9, pos, nmsk;
  vector<int> dp(t, oo);
  dp[0] = 0;
  t--;
  for (int msk = 0; msk < t; ++msk) {
    for (int i = 0; i < m; ++i) {
      if ((msk >> i) & 1) continue;
      pos = __builtin_popcount(msk);
      nmsk = msk | (1 << i);
      dp[nmsk] =
          min(dp[nmsk], dp[msk] + pos * (sum[msk][i] - sum[t ^ nmsk][i]));
    }
  }
  cout << dp[t] << "\n";
  return 0;
}
