#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int64_t mod = 1e9 + 7;
int64_t mod1 = 1e9 + 5;
int64_t power(int64_t a, int64_t b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return power((((a % mod) * (a % mod)) % mod), b / 2) % mod;
  else
    return ((a % mod) * (power((((a % mod) * (a % mod)) % mod), b / 2) % mod)) %
           mod;
}
int co[21][21];
int dp[1ll << 20];
int n, m;
int fin(int mask) {
  int &res = dp[mask];
  if (res != -1) return res;
  if (mask == 0) return 0;
  res = 1e9;
  for (int i = 0; i < m; ++i) {
    if ((1ll << i) & mask) {
      int cost = 0;
      int temp = __builtin_popcount(mask);
      for (int j = 0; j < m; ++j) {
        if (j == i) continue;
        if ((1ll << j) & mask) {
          cost += co[i][j];
        } else {
          cost -= co[i][j];
        }
      }
      res = min(res, fin(mask ^ (1ll << i)) + cost * temp);
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  memset(co, 0, sizeof(co));
  memset(dp, -1, sizeof(dp));
  cin >> n >> m;
  string s;
  cin >> s;
  for (int i = 1; i < n; ++i) {
    co[s[i - 1] - 'a'][s[i] - 'a']++;
    co[s[i] - 'a'][s[i - 1] - 'a']++;
  }
  cout << fin((1ll << m) - 1);
}
