✅ Approach:
step 1 :- Read inputs: total string length n, number of distinct letters k, and the string s.
step 2 :- Count frequency of each uppercase letter ('A' to 'Z') in the string using an array f[26].
step 3 :- Find the minimum frequency among the first k letters (i.e., from 'A' to 'A' + k - 1).
step 4 :- Multiply that minimum frequency by k to get the total number of letters used in all complete groups.
step 5 :- Print the result.