You are given a string *S* of length *n* with each character being one of the first *m* lowercase English letters. 

Calculate how many different strings *T* of length *n* composed from the first *m* lowercase English letters exist such that the length of LCS (longest common subsequence) between *S* and *T* is *n* - 1.

Recall that LCS of two strings *S* and *T* is the longest string *C* such that *C* both in *S* and *T* as a subsequence.
The first line contains two numbers *n* and *m* denoting the length of string *S* and number of first English lowercase characters forming the character set for strings (1 ≤ *n* ≤ 100 000, 2 ≤ *m* ≤ 26).

The second line contains string *S*.
line = list(map(int,input().split()))
n = line[0]
m = line[1]

s = input()
a = [0]*(n+2)

for i in range(n):
    a[i+1] = ord(s[i]) - ord('a') + 1
dp = [[0] * 8 for _ in range(n+1)]

for i in range(1,m+1):
    st = 1
    if i == a[1]:
        st |= 2 #equivale a activar el estado que tiene el bit del centro prendido(posición [1,1])
    if i == a[1] or i == a[2]:
        st |= 4 #equivale a activar el estado que tiene el 3er bit prendido(posición [1,2])
    dp[1][st] += 1

for i in range(1,n):
    for st in range(8):
        if dp[i][st] == 0:
            continue
        f = i-2 + (st&1)
        s = i-1 + ((st>>1)&1)
        t = i-1 + ((st>>2)&1)
        for j in range(1,m+1):
            f1 = max(s,f + (1 if j == a[i] else 0))
            s1 = max(max(f1,t), s + (1 if j == a[i+1] else 0))
            t1 = max(s1, t + (1 if j == a[i+2] else 0))

            if f1 < i - 1 or s1 < i or t1 < i:
                continue
            f1 -= (i-1)
            s1 -= i
            t1 -= i
            newSt = f1|s1<<1|t1<<2
            dp[i+1][newSt] += dp[i][st]

print(dp[n][0] + dp[n][1] + dp[n][4] + dp[n][5])
