#include <bits/stdc++.h>
using namespace std;
void input(long long int n, long long int a[]) {
  for (long long int i = 0; i < n; ++i) cin >> a[i];
}
long long int bin_expo(long long int A, long long int B, long long int M) {
  long long int res = 1ll;
  while (B > 0) {
    if (B % 2 == 1) {
      res = (res * A) % M;
    }
    A = (A * A) % M;
    B = B / 2;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
int n, m;
long long int mask;
char str[200005];
long long int freq[26][26];
long long int dp[(1 << 21) + 55];
long long int solve(long long int cur) {
  if (cur == mask) return 0;
  if (dp[cur] != -1) return dp[cur];
  long long int sz = __builtin_popcount(cur);
  long long int ans = INT_MAX;
  for (int i = 0; i < m; i++) {
    if (!((1 << i) & cur)) {
      long long int res1 = 0, res2 = 0;
      for (int j = 0; j < m; j++) {
        if (j != i) {
          if (((1 << j) & cur))
            res1 += freq[i][j];
          else
            res2 += freq[i][j];
        }
      }
      ans = min(ans, sz * (res1 - res2) + solve(cur ^ (1 << i)));
    }
  }
  return dp[cur] = ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  scanf("%d %d %s", &n, &m, str);
  mask = (1LL << m) - 1;
  for (int i = 1; i < n; i++) {
    freq[int(str[i] - 'a')][int(str[i - 1] - 'a')]++;
    freq[int(str[i - 1] - 'a')][int(str[i] - 'a')]++;
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0LL) << endl;
  return 0;
}
