#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = 1e18;
const int N = 2 * 1e6 + 10;
ll res;
ll dp[N];
ll a[N], h[40][40];
void solve() {
  ll n, m;
  string s;
  cin >> n >> m >> s;
  for (int i = 1; i < s.size(); ++i) {
    ++h[s[i] - 'a'][s[i - 1] - 'a'];
    ++h[s[i - 1] - 'a'][s[i] - 'a'];
  }
  fill(dp, dp + N, inf);
  dp[0] = 0;
  for (int mask = 0; mask < (1LL << m); ++mask) {
    ll pos = __builtin_popcount(mask);
    for (int i = 0; i < m; ++i) {
      if (!(mask & 1LL << i)) {
        ll sum = 0;
        for (int j = 0; j < m; ++j) {
          if (i == j) continue;
          if (mask & 1LL << j)
            sum += h[i][j];
          else
            sum -= h[i][j];
        }
        dp[mask | 1LL << i] = min(dp[mask | 1LL << i], dp[mask] + sum * pos);
      }
    }
  }
  cout << dp[(1LL << m) - 1];
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t = 1;
  while (t--) {
    solve();
  }
}
