#include <bits/stdc++.h>
using namespace std;
int n, m, f[(1 << 20)], cnt[20][20];
string s;
int main() {
  cin >> n >> m >> s;
  for (int i = 1; i < n; i++) {
    int a = s[i - 1] - 'a', b = s[i] - 'a';
    if (a != b) {
      cnt[a][b]++;
      cnt[b][a]++;
    }
  }
  fill(f + 1, f + (1 << m), INT_MAX);
  for (int i = 0; i < (1 << m) - 1; i++) {
    int c = __builtin_popcount(i);
    for (int j = 0; j < m; j++) {
      if (!(i & (1 << j))) {
        int tmp = f[i];
        for (int k = 0; k < m; k++) {
          if (i & (1 << k)) {
            tmp += cnt[j][k] * c;
          } else {
            tmp -= cnt[j][k] * c;
          }
        }
        f[i | (1 << j)] = min(f[i | (1 << j)], tmp);
      }
    }
  }
  cout << f[(1 << m) - 1] << endl;
  return 0;
}
