#include <bits/stdc++.h>
using namespace std;
const int N = 1 << (20);
int n, m;
int dp[N];
int adj[20][20];
const int INF = 1e9;
int all;
int cal(int mask) {
  if (dp[mask] != -1) {
    return dp[mask];
  }
  if (mask == all) {
    return 0;
  }
  int cnt = 0;
  for (int i = 0; i < m; i++) {
    if (mask & (1 << i)) continue;
    for (int j = 0; j < m; j++) {
      if (mask & (1 << j)) {
        cnt += adj[i][j];
      }
    }
  }
  int ans = INF;
  for (int i = 0; i < m; i++) {
    if (mask & (1 << i)) continue;
    ans = min(ans, cal(mask | (1 << i)));
  }
  return dp[mask] = ans + cnt;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  string s;
  cin >> s;
  memset(adj, 0, sizeof adj);
  for (int i = 1; i < n; i++) {
    int a = s[i] - 'a', b = s[i - 1] - 'a';
    adj[a][b]++;
    adj[b][a]++;
  }
  memset(dp, -1, sizeof dp);
  all = (1 << m) - 1;
  cout << cal(0) << '\n';
  return 0;
}
