#include <bits/stdc++.h>
using namespace std;
const int M = 1200000;
const int inf = 0x3f3f3f3f;
int n, m, k;
char s[M];
int cnt[30][30];
int dp[M];
int main() {
  memset(dp, inf, sizeof(dp));
  dp[0] = 0;
  cin >> n >> m >> s;
  for (int i = (0); i <= (n - 2); ++i) {
    cnt[s[i] - 'a'][s[i + 1] - 'a']++;
    cnt[s[i + 1] - 'a'][s[i] - 'a']++;
  }
  for (int i = (1); i <= ((1 << m) - 1); ++i) {
    vector<int> a[2];
    for (int j = (0); j <= (m - 1); ++j) a[i >> j & 1].push_back(j);
    int c = 0;
    for (int u : a[0])
      for (int v : a[1]) c += cnt[u][v];
    for (int j : a[1]) {
      dp[i] = min(dp[i], dp[i ^ (1 << j)] + c);
    }
  }
  cout << dp[(1 << m) - 1] << endl;
  return 0;
}
