Problem: You have a password which you often type — a string s of length n. Every character of this string is one of the first m lowercase Latin letters.

Since you spend a lot of time typing it, you want to buy a new keyboard.

A keyboard is a permutation of the first m Latin letters. For example, if m = 3, then there are six possible keyboards: abc, acb, bac, bca, cab and cba.

Since you type your password with one finger, you need to spend time moving your finger from one password character to the next. The time to move from character s_i to character s_{i+1} is equal to the distance between these characters on keyboard. The total time you have to spend typing the password with a keyboard is called the slowness of this keyboard.

More formaly, the slowness of keyboard is equal to ∑_{i=2}^{n} |pos_{s_{i-1}} - pos_{s_i} |, where pos_x is position of letter x in keyboard.

For example, if s is aacabc and the keyboard is bac, then the total time of typing this password is |pos_a - pos_a| + |pos_a - pos_c| + |pos_c - pos_a| + |pos_a - pos_b| + |pos_b - pos_c| = |2 - 2| + |2 - 3| + |3 - 2| + |2 - 1| + |1 - 3| = 0 + 1 + 1 + 1 + 2 = 5.

Before buying a new keyboard you want to know the minimum possible slowness that the keyboard can have. 

Input

The first line contains two integers n and m (1 ≤ n ≤ 10^5, 1 ≤ m ≤ 20).

The second line contains the string s consisting of n characters. Each character is one of the first m Latin letters (lowercase).

Output

Print one integer – the minimum slowness a keyboard can have.

Examples

Input


6 3
aacabc


Output


5


Input


6 4
aaaaaa


Output


0


Input


15 4
abacabadabacaba


Output


16

Note

The first test case is considered in the statement.

In the second test case the slowness of any keyboard is 0.

In the third test case one of the most suitable keyboards is bacd.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MD = 1e9 + 7;
const double pi = acos(-1);
struct segmentTree {
  int tl = 1, tr = (1ll << 19);
  segmentTree* left = nullptr;
  segmentTree* right = nullptr;
  int val = 0;
  int push = 0;
  segmentTree(int tl, int tr) : tl(tl), tr(tr) {}
  segmentTree() = default;
  void createSons() {
    int tm = (tl + tr) / 2;
    if (!left) {
      left = new segmentTree(tl, tm);
    }
    if (!right) {
      right = new segmentTree(tm + 1, tr);
    }
  }
  void doPush() {
    createSons();
    if (push) {
      left->push += push;
      right->push += push;
      val += push;
      push = 0;
    }
  }
  void update(int l, int r, int val) {
    doPush();
    if (l > r) {
      return;
    }
    if (tl == l && r == tr) {
      push += val;
      doPush();
      return;
    }
    createSons();
    int tm = (tl + tr) / 2;
    left->update(l, min(r, tm), val);
    right->update(max(tm + 1, l), r, val);
    this->val = max(left->val, right->val);
  }
  int get(int l, int r) {
    doPush();
    if (l > r) {
      return 0;
    }
    if (l == tl && tr == r) {
      return val;
    }
    int tm = (tl + tr) / 2;
    return max(left->get(l, min(r, tm)), right->get(max(tm + 1, l), r));
  }
};
ostream& operator<<(ostream& stream, const vector<int>& v) {
  for (auto i : v) {
    stream << i << " ";
  }
  return stream;
}
pair<int, int> operator+=(pair<int, int>& a, const pair<int, int>& b) {
  a.first += b.first;
  a.second += b.second;
  return a;
};
int sqr(int a) { return a * a % MD; }
int binpow(int a, int b) {
  if (b == 0) {
    return 1;
  }
  if (b % 2 == 0) {
    return sqr(binpow(a, b / 2));
  }
  return a * binpow(a, b - 1) % MD;
}
int fact(int a) {
  int res = 1;
  for (int i = 2; i <= a; i++) {
    res *= i;
    res %= MD;
  }
  return res;
}
int dp[(1ll << 20)];
int cnt[30][30];
int n, m;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  string st;
  cin >> st;
  for (int i = 0; i < (int)st.size() - 1; i++) {
    cnt[st[i] - 'a'][st[i + 1] - 'a']++;
    cnt[st[i + 1] - 'a'][st[i] - 'a']++;
  }
  for (int mask = 0; mask < (1 << 20); mask++) {
    dp[mask] = INF;
  }
  dp[0] = 0;
  for (int mask = 0; mask < (1 << 20); mask++) {
    if (dp[mask] == INF) {
      continue;
    }
    vector<int> zeros;
    for (int j = 0; j < m; j++) {
      if (mask & (1 << j)) {
      } else {
        zeros.push_back(j);
      }
    }
    for (auto& let : zeros) {
      int toAdd = 0;
      for (int j = 0; j < m; j++) {
        if (j == let) {
          continue;
        }
        if (mask & (1 << j)) {
          toAdd += cnt[j][let];
        } else {
          toAdd -= cnt[j][let];
        }
      }
      toAdd *= m - zeros.size();
      int newMask = mask | (1 << let);
      dp[newMask] = min(dp[newMask], dp[mask] + toAdd);
    }
  }
  cout << dp[(1 << m) - 1] << "\n";
}