#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
int n, m, cnt[30][30];
string s;
int dp[(1 << 20)];
int go(int mask) {
  if (mask == (1 << m) - 1) return 0;
  int &r = dp[mask];
  if (r != -1) return r;
  r = INT_MAX;
  int pos = __builtin_popcount(mask);
  for (int i = 0; i < m; i++) {
    if ((mask >> i) & 1) continue;
    int val = 0;
    for (int j = 0; j < m; j++) {
      if (i == j) continue;
      if ((mask >> j) & 1) {
        val += (cnt[j][i] + cnt[i][j]) * pos;
      } else {
        val -= (cnt[j][i] + cnt[i][j]) * pos;
      }
    }
    r = min(r, go(mask | (1 << i)) + val);
  }
  return r;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> s;
  for (int i = 0; i < n - 1; i++) cnt[s[i] - 'a'][s[i + 1] - 'a']++;
  memset(dp, -1, sizeof dp);
  cout << go(0) << endl;
  return 0;
}
