Count length-n strings over the first m letters whose longest common subsequence with a given string S has length exactly n-1.
You are given a string SSS of length nnn that uses only the first mmm lowercase letters of the alphabet.
Count the strings TTT of length nnn, built from the same mmm letters, whose longest common subsequence (LCS) with SSS has length exactly n−1n-1n−1.
A subsequence of a string is what remains after deleting zero or more characters and keeping the order of the characters that stay.
The first line contains the string length nnn and the alphabet size mmm, separated by a space. (1≤n≤1000001 \le n \le 1000001≤n≤100000, 2≤m≤262 \le m \le 262≤m≤26)
The second line contains the string SSS. Its length is nnn, and it uses only the first mmm lowercase letters starting from a.
a
Print the number of strings that satisfy the condition on one line.