You are given a string $s$ of length $n$, which consists only of the first $k$ letters of the Latin alphabet. All letters in string $s$ are uppercase.

A subsequence of string $s$ is a string that can be derived from $s$ 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 $s$ called good if the number of occurences of each of the first $k$ letters of the alphabet is the same.

Find the length of the longest good subsequence of $s$. 


-----Input-----

The first line of the input contains integers $n$ ($1\le n \le 10^5$) and $k$ ($1 \le k \le 26$).

The second line of the input contains the string $s$ of length $n$. String $s$ only contains uppercase letters from 'A' to the $k$-th letter of Latin alphabet.


-----Output-----

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


-----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 $0$.

Difficulty: interview

Starter code:

Solutions:
from collections import Counter
n, k = list(map(int, input().split()))
c = Counter(input())
ans = min(c[chr(ord('A') + i)] for i in range(k))
print(k * ans)


read = lambda: map(int, input().split())
n, k = read()
s = input()
c = [0] * 26
for i in range(n):
    if s[i] <= chr(ord('A') + k - 1):
        c[ord(s[i]) - ord('A')] += 1
print(min(c[:k]) * k)

n, k = map(int, input().split(' '))
s = input()
m = 10 ** 10
for i in range(k):
    c = chr(ord('A') + i)
    m = min(m, s.count(c))
print(m * k)

ct = [0]*26

n, k =[int(i) for i in input().split()]
s = input()

for i in s:
    ct[ord(i)-ord('A')]+=1

print(min(ct[:k])*k)


import sys
import string


def ria():
    return [int(i) for i in input().split()]


n, k = ria()
mp = {}
for i in string.ascii_uppercase[:k]:
    mp[i] = 0
for i in input():
    if i in mp:
        mp[i] += 1
print(min(mp.values())*k)

n, k = list(map(int, input().split()))
count = [0] * k
for c in input():
    count[ord(c) - ord("A")] += 1
print(k * min(count))



def ii():
    return int(input())
def mi():
    return list(map(int, input().split()))
def li():
    return list(mi())
from collections import Counter

alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

n, k = mi()
s = input().strip()
c = Counter(s)
mn = 10 ** 9
for ch in alpha[:k]:
    mn = min(mn, c[ch])
print(mn * k)


from collections import Counter


def __starting_point():
    n, k = list(map(int, input().split()))
    s = input()
    c = Counter(s)
    min_symbols = min(c[chr(ord("A") + i)] for i in range(k))
    print(min_symbols * k)

__starting_point()

n, k = map(int, input().split())
s = list(input())
a = ord('A')
cnt = [0] * k
for ch in s:
    cnt[ord(ch) - a] += 1
print(k * min(cnt))

#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        print(*args, **kwargs, file=sys.stderr)
    dprint('debug mode')
except ModuleNotFoundError:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, K= getIntList()
zs = input()
t = {}
for x in zs:
    if x not in t:
        t[x] = 1
    else:
        t[x]+=1
ff = 100000
for y in t:
    ff = min(ff, t[y])
if len(t)<K:
    ff = 0
print(ff*K)









n, k = list(map(int, input().split()))
u = list(input())
s = [0] * k
c = ord('A')
for i in range(n):
    s[ord(u[i]) - c] += 1
print(min(s) * k)
   


from collections import Counter

n, k = list(map(int, input().split()))
s = input()

letters = list(s)

c = dict(Counter(letters))

if len(c) < k:
	print(0)
else:
	print(k * min(c.values()))

USE_STDIO = False

if not USE_STDIO:
    try: import mypc
    except: pass

from collections import Counter

def main():
    n, k = list(map(int, input().split(' ')))
    s = input()
    cnts = Counter(s)
    ans = n
    for i in range(k):
        ch = chr(ord('A') + i)
        ans = min(ans, cnts.get(ch, 0))
    print(ans * k)

def __starting_point():
    main()




__starting_point()

n,k=map(int,input().split())
a=list(input())
g=[0]*k
for i in a :
    g[ord(i)-65]+=1
print(k*min(g))    

n, k = map(int, input().split())
s = input()
upper = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")[:k]
d = dict()
for u in upper:
	d[u] = 0
for l in s:
	d[l] += 1

print(min(d.values()) * k)

#Problem A

inp = input().split()
n = int(inp[0])
k = int(inp[1])

s = input()

cnt = {}
for c in s:
    cnt[c] = cnt.get(c,0)+1

if(len(cnt)<k):
    print(0)
else:
    ans = cnt["A"]
    for c,v in cnt.items():
        ans = min(ans,v)
    print(ans*k)

def mi():
    return list(map(int, input().split(' ')))


n,m = mi()
s =input()
ans = 1000000
for i in range(m):
    ans = min(ans,s.count(chr(65+i)))

print(ans*m)


#!/usr/bin/env python3
#-*- encoding: utf-8 -*-

import sys
import bisect
from collections import Counter

read_int = lambda : int(sys.stdin.readline())
read_ints = lambda : list(map(int,sys.stdin.readline().split()))
read_int_list = lambda : list(read_ints())
read = lambda : sys.stdin.readline().strip()
read_list = lambda : sys.stdin.readline().split()

def main():
    n,k = read_ints()
    s = read()
    d = Counter(s)
    res = k*min(d.values()) if len(d) == k else 0
    print(res)


main()


n,k=list(map(int,input().split()))
s=input()
a=[0]*26
for i in s:
	a[ord(i)-ord('A')]+=1
ans=100000000
for i in range(k):
	ans=min(ans,a[i])
print(ans*k)


import sys
import os

def solve(s, k):
    occ = [0] * 26
    for i in range(len(s)):
        occ[ord(s[i]) - ord('A')] += 1

    result = None
    for i in range(k):
        if result is None:
            result = occ[i]
        else:
            result = min(result, occ[i])

    return result * k

def main():
    n, k = map(int, input().split())
    s = input()
    print(solve(s, k))


def __starting_point():
    main()
__starting_point()

n, k = list(map(int, input().split()))
s = input()
g = [0] * k
for i in s:
	g[ord(i) - 65] += 1
print(k * min(g))


n, k = list(map(int, input().split()))
s = input()

cnt = {k: 0 for k in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[:k]}

for c in s:
    cnt[c] += 1

v = n
for c in cnt:
    v = min(v, cnt[c])

print(v * k)


n, k = map(int, input().split())
s = input()
num = dict()
all1 = []
ans = 1000000000000
for i in range(65, 65 + k):
    all1.append(chr(i))
for i in range(n):
    if not s[i] in num:
        num[s[i]] = 1
    else:
        num[s[i]] += 1
for i in range(k):
    if all1[i] not in num:
        ans = 0
        break
    ans = min(ans, num[all1[i]])
print(ans * k)

n, k = map(int, input().split())
s = input()
d = [0 for _ in range(k)]
for i in s:
    d[ord(i) - ord('A')] += 1
#al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#for i in 
print(min(d) * k)

n,k=map(int,input().split())
s=input()
min_c = n*2
for i in range(k):
    c = chr(ord('A')+i)
    min_c = min(min_c, s.count(c))
print(min_c*k)