#include <bits/stdc++.h>
using namespace std;
const int O = 2e6 + 5;
int n, m, dp[O], f[21][21];
string s;
void Minimize(int &x, int y) {
  if (x > y) x = y;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> s;
  for (int i = 1; i < n; ++i) {
    int x = s[i] - 'a';
    int y = s[i - 1] - 'a';
    f[x][y] += 1;
    f[y][x] += 1;
  }
  for (int i = 1; i < (1 << m); ++i) dp[i] = 1e9;
  for (int i = 0; i < (1 << m); ++i) {
    int o = __builtin_popcount(i) + 1;
    for (int j = 0; j < m; ++j) {
      if ((i & (1 << j)) == 0) {
        int sum = 0;
        for (int z = 0; z < m; ++z) {
          if (z == j) continue;
          if (i & (1 << z)) sum += f[j][z] * o;
          if ((i & (1 << z)) == 0) sum -= f[j][z] * o;
        }
        Minimize(dp[i | (1 << j)], sum + dp[i]);
      }
    }
  }
  cout << dp[(1 << m) - 1];
}
