from collections import Counter
class Istr():
    def count(self, s, k):
        c = Counter(s)
        for _ in range(k): c[c.most_common(1)[0][0]] -= 1
        return sum(mapx(lambda x: x*x, c.values()))

22f55f7aa403f8b1c84b9aa689578335a49c4d05
<mask token>

<mask token>


class Istr:
    <mask token>

<mask token>


class Istr:

    def count(self, s, k):
        c = Counter(s)
        for _ in range(k):
            c[c.most_common(1)[0][0]] -= 1
        return sum(mapx(lambda x: x * x, c.values()))

from collections import Counter


class Istr:

    def count(self, s, k):
        c = Counter(s)
        for _ in range(k):
            c[c.most_common(1)[0][0]] -= 1
        return sum(mapx(lambda x: x * x, c.values()))

from collections import Counter
class Istr():
    def count(self, s, k):
        c = Counter(s)
        for _ in range(k): c[c.most_common(1)[0][0]] -= 1
        return sum(mapx(lambda x: x*x, c.values()))
