Appleman has n cards. Each card has an uppercase letter written on it. Toastman must choose k cards from Appleman's cards. Then Appleman should give Toastman some coins depending on the chosen cards. Formally, for each Toastman's card i you should calculate how much Toastman's cards have the letter equal to letter on ith, then sum up all these quantities, such a number of coins Appleman should give to Toastman.

Given the description of Appleman's cards. What is the maximum number of coins Toastman can get?

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 105). The next line contains n uppercase letters without spaces — the i-th letter describes the i-th card of the Appleman.

Output

Print a single integer – the answer to the problem.

Examples

Input

15 10
DZFDFZDFDDDDDDF


Output

82


Input

6 4
YJSNPI


Output

4

Note

In the first test example Toastman can choose nine cards with letter D and one additional card with any letter. For each card with D he will get 9 coins and for the additional card he will get 1 coin.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;

public class Round260 {

    public static void main(String[] args) {

        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(in, out);
        out.close();
    }
}

/*
 * My love has gone away,
 * 
 * quietly after a hundered days.
 * 
 * This is what's she has always said she won't stay
 * 
 * for more than what she can repay.
 * 
 * I can still hear her say
 * 
 * there that I'm not hearing tender play
 * 
 * The day she let me kiss her was a display,
 * 
 * of love to those who she betray.
 */

class TaskB {

    public void solve(InputReader in, PrintWriter out) {
        int n = in.nextInt();
        long k = in.nextLong();
        String s = in.next();
        char[] a = s.toCharArray();
        
        Long[] cnt = new Long[26];
        
        for (int i = 0; i < 26; i++) {
            cnt[i] = new Long("0");
        }
        
        for (int i = 0; i < n; i++) {
            cnt[a[i] - 'A']++;
        }
        
        Arrays.sort(cnt, Collections.reverseOrder());
        
        int i = 0;
        long res = 0;
        while(k > 0)
        {
            if(cnt[i] >= k)
            {
                res+= k*k;
                k = 0;
            }
            else
            {
                res +=cnt[i]*cnt[i];
                k-=cnt[i];
            }
            i++;
        }
        out.println(res);
    }
}


/*
 * How can I put someone to the test,
 * 
 * when I thought I got the best.
 * 
 * Untill the taste of bitterness then I regret
 * 
 * but still that I won't detest,
 * 
 * the love I can't forget,
 * 
 * like someone who has left.
 * 
 * How can i leave someone for the rest
 * 
 * when i'm alone facing the best
 * 
 * Untill they take some try to reason i regret
 * 
 * But still that i won't detest
 * 
 * who i can never forget
 * 
 * like someone i once met ..
 */

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
