#include <bits/stdc++.h>
using namespace std;
int sum[21][21];
int arr[100001];
int dp[2000001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j <= m; j++) {
      sum[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    arr[i] = int(c) - 97;
  }
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    if (arr[i] != arr[i + 1]) {
      sum[arr[i]][arr[i + 1]]++;
      sum[arr[i + 1]][arr[i]]++;
    }
  }
  for (int i = 0; i < (1 << m); i++) {
    dp[i] = 1e9;
  }
  dp[0] = 0;
  for (int i = 1; i < (1 << m); i++) {
    int c = i;
    for (int j = 0; j < m; j++) {
      if (c & 1) {
        int d = i;
        int tmp = dp[i - (1 << j)];
        int e = 0;
        int num = 0;
        while (d > 0) {
          if (d & 1) {
            num++;
          }
          d >>= 1;
        }
        d = i;
        for (int k = 0; k < m; k++) {
          if (d & 1) {
            tmp = tmp + sum[j][k] * (num);
          } else {
            tmp = tmp - sum[j][k] * (num);
          }
          if (d > 0) d >>= 1;
        }
        dp[i] = min(tmp, dp[i]);
      }
      c >>= 1;
    }
  }
  cout << dp[(1 << m) - 1] << "\n";
}
