#include <bits/stdc++.h>
using namespace std;
const long long N = 100010;
long long ans, k, n;
int main() {
  long long i, j, tmp = 1;
  scanf("%lld%lld", &n, &k);
  char ch = getchar(), s1 = '-', s2 = '-';
  while (ch < 'a' || ch > 'z') ch = getchar();
  s1 = ch;
  ans = n * (k - 1);
  for (i = 1; i < n; i++) {
    ch = getchar();
    tmp = (ch == s2) ? tmp + 1 : 0;
    if (ch != s1) ans += n * (k - 1) - tmp - 1;
    s2 = s1, s1 = ch;
  }
  cout << ans << endl;
  return ~~(0 - 0);
}
