#include <bits/stdc++.h>
using namespace std;
const int N = 500009;
const int MOD = 1000000007;
int n, m;
string s;
int cnt[21][21];
int dp[1 << 21];
void pre() {
  for (int i = 0; (i + 1) < s.length(); i++) {
    if (s[i] != s[i + 1])
      cnt[s[i] - 'a'][s[i + 1] - 'a']++, cnt[s[i + 1] - 'a'][s[i] - 'a']++;
  }
  for (int i = 0; i < (1 << 20); i++) {
    dp[i] = INT_MAX;
  }
  dp[0] = 0;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> m >> n >> s;
  pre();
  for (int i = 0; i < (1 << n); i++) {
    int x = -1;
    int cnti = __builtin_popcount(i);
    for (int j = 0; j < n; j++) {
      if ((i & (1 << j)) != 0) {
        continue;
      }
      int temp = 0;
      for (int k = 0; k < n; k++) {
        if ((i & (1 << k)) == 0)
          temp -= cnt[j][k] * cnti;
        else
          temp += cnt[j][k] * cnti;
      }
      dp[(i | (1 << j))] = min(dp[i] + temp, dp[(i | (1 << j))]);
      x = cnti;
    }
  }
  cout << dp[(1 << n) - 1] << "\n";
}
