#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 5;
long long n, m;
char s[maxn];
long long dp[1 << 21];
long long cnt[25][25];
int main() {
  scanf("%lld %lld", &n, &m);
  scanf("%s", s + 1);
  for (int i = 2; i <= n; i++) {
    cnt[s[i - 1] - 'a'][s[i] - 'a']++;
  }
  memset(dp, 0x3f, sizeof(dp));
  dp[0] = 0;
  for (int i = 0; i < (1 << m); i++) {
    long long bt = 0;
    for (int j = 0; j < m; j++) {
      bt += ((i >> j) & 1);
    }
    for (int j = 0; j < m; j++) {
      if ((i >> j) & 1) continue;
      long long sum = 0;
      for (int k = 0; k < m; k++) {
        if (k == j) continue;
        if ((i >> k) & 1)
          sum += cnt[j][k] + cnt[k][j];
        else
          sum -= cnt[j][k] + cnt[k][j];
      }
      dp[i | (1 << j)] = min(dp[i | (1 << j)], dp[i] + sum * (bt + 1));
    }
  }
  cout << dp[(1 << m) - 1] << endl;
  return 0;
}
