#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAX(int &a, int b) { return a = max(a, b); }
const int MIN(int &a, int b) { return a = min(a, b); }
int n, m, ct[21][21], dp[1 << 21], lowest[1 << 21], dist[1 << 21][21];
string second;
void read() { cin >> n >> m >> second; }
void solve() {
  for (int i = 0; i < second.size() - 1; i++) {
    ct[second[i] - 'a'][second[i + 1] - 'a']++;
    ct[second[i + 1] - 'a'][second[i] - 'a']++;
  }
  for (int i = 0; i < (1 << 21); i++) {
    dp[i] = (1e9 * 1) + 5;
  }
  dp[0] = 0;
  for (int i = 1; i <= (1 << m) - 1; i++) {
    for (int j = 0; j < 20; j++) {
      if ((i >> j) & 1) {
        lowest[i] = j;
        break;
      }
    }
  }
  for (int i = 1; i <= (1 << m) - 1; i++) {
    for (int j = 0; j < m; j++) {
      int x = lowest[i];
      dist[i][j] = dist[i ^ (1 << x)][j] + ct[j][x];
    }
  }
  for (int i = 0; i < (1 << m); i++) {
    for (int j = 0; j < m; j++) {
      if ((i >> j) & 1) continue;
      int pos = __builtin_popcount(i);
      MIN(dp[i | (1 << j)],
          dp[i] +
              pos * (dist[i][j] - dist[((1 << m) - 1) ^ (i | (1 << j))][j]));
    }
  }
  cout << dp[(1 << m) - 1] << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    read();
    solve();
  }
}
