#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long big = inf * 1LL * inf;
const int maxn = 1e6;
int n, m;
string s;
int cnt[26][26];
int dp[1 << 21];
int solve(int mask) {
  if (!mask) return dp[mask] = 0;
  if (dp[mask] != inf) return dp[mask];
  int cntBit = 0;
  for (int i = 0; i < m; ++i) {
    if ((1 << i) & mask) cntBit++;
  }
  for (int i = 0; i < m; ++i) {
    int tCntSet = 0, tCntNotSet = 0;
    for (int j = 0; j < m; ++j) {
      if (i != j and (1 << j) & mask) {
        tCntSet += cnt[i][j];
      } else if (i != j) {
        tCntNotSet += cnt[i][j];
      }
    }
    if ((1 << i) & mask) {
      dp[mask] = min(dp[mask],
                     solve(mask ^ (1 << i)) + (tCntSet - tCntNotSet) * cntBit);
    }
  }
  return dp[mask];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> s;
  for (int i = 0; i < (1 << m); ++i) dp[i] = inf;
  for (int i = 1; i < s.size(); ++i) {
    cnt[s[i] - 'a'][s[i - 1] - 'a']++;
    if (s[i] != s[i - 1]) cnt[s[i - 1] - 'a'][s[i] - 'a']++;
  }
  cout << solve((1 << m) - 1);
  return 0;
}
