#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
int dp[1 << 21];
int cnt[30][30];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  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, (0x3f3f3f3f), sizeof(dp));
  dp[0] = 0;
  for (int i = 0; i < (1 << m); ++i) {
    int sum = 0;
    for (int j = 0; j < m; ++j) {
      if (i & (1 << j))
        for (int k = 0; k < m; ++k)
          if (!(i & (1 << k))) sum += cnt[j][k];
    }
    for (int j = 0; j < m; ++j)
      dp[i | (1 << j)] = min(dp[i | (1 << j)], dp[i] + sum);
  }
  cout << dp[(1 << m) - 1] << '\n';
  return 0;
}
