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.*;
import java.util.*;
import java.util.List;

public class Main2 {
    private static StringTokenizer st;
    private static BufferedReader br;

    public static void print(Object x) {
        System.out.println(x + "");
    }
    public static String join(List<?> x, String space) {
        StringBuilder sb = new StringBuilder();
        for (Object elt : x) {
            sb.append(elt);
            sb.append(space);
        }
        return sb.toString();
    }

    public static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine().trim());
        }
        return st.nextToken();
    }
    public static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public static List<Double> nextDoubles(int n) throws IOException{
        List<Double> lst = new ArrayList<Double>();
        for (int i = 0; i < n; i++) {
            lst.add(nextDouble());
        }
        return lst;
    }
    public static List<Integer> nextInts(int n) throws IOException{
        List<Integer> lst = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            lst.add(nextInt());
        }
        return lst;
    }
    public static List<Long> nextLongs(int n) throws IOException{
        List<Long> lst = new ArrayList<Long>();
        for (int i = 0; i < n; i++) {
            lst.add(nextLong());
        }
        return lst;
    }

    public static List<Integer> emptyList(int n, int val) {
        List<Integer> lst = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            lst.add(val);
        }
        return lst;
    }

    public static class Fenwick {
        List<Integer> treeValues;
        int length;

        public Fenwick(int length) {
            this.length = length;
            treeValues = new ArrayList<Integer>();
            for (int i = 0; i <= length; i++) {
                treeValues.add(0);
            }
        }

        public int get(int i) {
            return getCumulative(i) - getCumulative(i - 1);
        }

        public int getCumulative(int i) {
            //print("Getting cumulative " + i);
            int total = 0;
            while (i > 0) {
                total += treeValues.get(i);
                i -= (i & -i);
            }
            return total;
        }

        public void increment(int i, int val) {
            //print("Incrementing " + i);
            while (i <= length) {
                treeValues.set(i, treeValues.get(i) + val);
                i += (i & -i);
            }
        }

        public void set(int i, int val) {
            increment(i, val - get(i));
        }
    }

    public static String solve() {
        return "";
    }

    public static void main(String[] args) throws Exception {
        boolean debug = false;
        InputStream in = System.in;
        if (debug) {
            in = new FileInputStream("input.in");
        }
        br = new BufferedReader(new InputStreamReader(in));

        int n = nextInt();
        int k = nextInt();
        String s = nextToken();

        Map<String, Integer> count = new HashMap<String, Integer>();
        for (int i = 0; i < n; i++) {
            String ch = s.substring(i, i + 1);
            if (!count.containsKey(ch)) {
                count.put(ch, 0);
            }
            count.put(ch, count.get(ch) + 1);
        }
        List<Map.Entry<String, Integer>> counts = new ArrayList<Map.Entry<String, Integer>>(count.entrySet());
        Collections.sort(counts, new Comparator<Map.Entry<String, Integer>>() {
            @Override
            public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
                if (o1.getValue().equals(o2.getValue())) {
                    return o1.getKey().compareTo(o2.getKey());
                } else {
                    return o1.getValue().compareTo(o2.getValue());
                }
            }
        });
        Collections.reverse(counts);

        long total = 0;
        int i = 0;
        while (k > 0) {
            int curCount = counts.get(i).getValue();
            long num = Math.min(k, curCount);
            //mahbubcseju you jerk ;_;
            k -= num;
            i++;
            total += num * num;
        }

        print(total);
    }
}
