题干:

You are given a string ss of length nn, which consists only of the first kk letters of the Latin alphabet. All letters in string ss are uppercase.

A subsequence of string ss is a string that can be derived from ss by deleting some of its symbols without changing the order of the remaining symbols. For example, "ADE" and "BD" are subsequences of "ABCDE", but "DEA" is not.

A subsequence of ss called good if the number of occurences of each of the first kkletters of the alphabet is the same.

Find the length of the longest good subsequence of ss.

Input

The first line of the input contains integers nn (1≤n≤1051≤n≤105) and kk (1≤k≤261≤k≤26).

The second line of the input contains the string ss of length nn. String ss only contains uppercase letters from 'A' to the kk-th letter of Latin alphabet.

Output

Print the only integer — the length of the longest good subsequence of string ss.

Examples

Input

9 3
ACAABCCAB

Output

6

Input

9 4
ABCABCABC

Output

0

Note

In the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.

In the second example, none of the subsequences can have 'D', hence the answer is 00.

解题报告:

    这题还是自己要读一遍,先解释了一遍子序列的概念,,这个很有往错误的方向诱导。。

    本来想着二分长度做,看数据量也刚刚好,但是做的时候发现根本不需要,其实就是很简单的一个预处理就ojbk了。

AC代码:

#include<bits/stdc++.h>

using namespace std;
const int MAX = 2e5 + 5;
char s[MAX];
int bk[55];
int main()
{
	int n,k;
	cin>>n>>k;
	cin>>s;
	int len = strlen(s);
	for(int i = 0; i<len; i++) {
		bk[s[i]-'A']++;
	}
	int minn = 0x3f3f3f3f;
	for(int i = 0; i<k; i++) {
		minn = min(minn,bk[i]);
	}
	cout << minn*k << endl;
	return 0 ;
}

//18:04 - 18:17