#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
int n, m;
char c[M];
int g[20][20];
int f[1 << 20][20];
int dp[1 << 20];
void dec(int& x, int y) {
  if (y < x) x = y;
}
int main() {
  scanf("%d%d%s", &n, &m, c + 1);
  for (int i = 2; i <= n; i++) {
    int a = c[i - 1] - 'a', b = c[i] - 'a';
    if (a > b) swap(a, b);
    g[a][b]++;
  }
  int mask = (1 << m) - 1;
  for (int l = 0; l < m; l++) {
    for (int i = 0; i <= mask; i++) {
      if ((1 << l) & i) continue;
      int t = 0;
      if (i == 0) {
        for (int j = 0; j < m; j++)
          if (j != l) {
            int a = l, b = j;
            if (a > b) swap(a, b);
            t -= g[a][b];
          }
      } else {
        for (int j = 0; j < m; j++) {
          if ((1 << j) & i) {
            int a = j, b = l;
            if (a > b) swap(a, b);
            t = f[i ^ (1 << j)][l] + g[a][b] * 2;
          }
        }
      }
      f[i][l] = t;
    }
  }
  memset(dp, 0x3f, sizeof dp);
  for (int i = 0; i < m; i++) {
    dp[0] = 0;
  }
  for (int i = 0; i <= mask; i++) {
    for (int j = 0; j < m; j++) {
      if ((1 << j) & i) continue;
      dec(dp[i | (1 << j)], dp[i] + f[i][j] * __builtin_popcount(i));
    }
  }
  printf("%d\n", dp[mask]);
}
