#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
const int M = 21;
int cur[M][M];
char s[N];
int n, m;
int val[(1 << M)], tmp;
long long dp[(1 << M)];
long long tmp1 = 0;
inline void add(int a, int b) {
  if (a == b) return;
  cur[a][b]++;
  cur[b][a]++;
}
int main() {
  for (int i = 0; i < (1 << M); i++) {
    tmp = i;
    while (tmp > 0) {
      val[i] += (tmp & 1);
      tmp >>= 1;
    }
  }
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    if (i) add(s[i - 1] - 'a', s[i] - 'a');
  }
  dp[(1 << m) - 1] = 0;
  for (int mask = (1 << m) - 2; mask >= 0; mask--) {
    dp[mask] = (long long)1e18;
    for (int i = 0; i < m; i++) {
      tmp1 = 0;
      if (((mask >> i) & 1) == 1) continue;
      for (int j = 0; j < m; j++) {
        if (i == j) continue;
        if (((mask >> j) & 1) == 1)
          tmp1 += (long long)val[mask] * cur[i][j];
        else
          tmp1 -= (long long)val[mask] * cur[i][j];
      }
      dp[mask] = min(dp[mask], tmp1 + dp[(mask ^ (1 << i))]);
    }
  }
  cout << dp[0] << endl;
  return 0;
}
