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.util.*;
import java.io.*;
public class Dazil{

	private static class Card{
		public char sign;
		public int freq;
		public Card(char s, int f){
			sign = s;
			freq = f;
		}
		@Override
		public String toString(){
			return "{"+sign+" : "+freq+"}";
		}
	}

	public static String chatRoom(String s){
		String greeting = "hello";
		int i = 0;
		int j = 0;
		while(i < greeting.length()
			&& j < s.length()){
			if(s.charAt(j) == greeting.charAt(i)){
				j = j + 1;
				i = i + 1;
			}else{
				j = j + 1;
			}
		}
		return (i == greeting.length())? "YES":"NO";
	}

	public static boolean isVowel(char c){

		if(c == 'a' || c == 'e' || c == 'i' || c == 'y' || c == 'o' || c == 'u')
			return true;
		return false;
	}

	public static String stringTask(String s){
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < s.length(); i++){
			char c = Character.toLowerCase(s.charAt(i));
			if(!isVowel(c)){
				sb.append(".").append(c);
			}
		}
		return sb.toString();
	}

	public static String sortString(String s){
		char temp[] = s.toCharArray();
		Arrays.sort(temp);
		return new String(temp);
	}
	public static String kString(String s, int k){
		return null;

	}
	/*
	public static String kString(String s, int k){
		if(s.length() % k != 0)
			return "-1";
		s = sortString(s);
		StringBuilder sb = new StringBuilder();
		int i = 0;

		while(i < s.length()){
			sb.append(s.charAt(i));
			i = i + k;
		}

		i = 1;
		StringBuilder temp = new StringBuilder(sb);
		while(i < k){
			temp.append(sb);
			i = i + 1;
		}
		String ans = sortString(temp.toString());
		return (s.equals(ans))? temp.toString() : "-1";
	}
	*/

	public static int maxProduct(int[] nums, int i, int j, int s, HashMap<String,Integer> memo){
        if(j == nums.length -1){
            //String key = "{"+i+","+j+"}";
            //memo.put(key, s*nums[j]);
            //return memo.get(key);
            return s*nums[j];
        }

        String key = "{"+i+","+j+"}";        
        if(memo.containsKey(key)){
        	return memo.get(key);
        }
        int curr = s * nums[j];
        int max = Math.max(curr, Math.max(maxProduct(nums, i, j + 1, curr, memo),
                                   maxProduct(nums, j + 1, j + 1, 1, memo)));
        memo.put(key, max);
        return max;
    }
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		HashMap<Character, Integer> map = new HashMap<>();
		String[] input = br.readLine().split(" ");
		int k = Integer.parseInt(input[0]);
		int n = Integer.parseInt(input[1]);
		String s  = br.readLine();
		for(int i = 0; i < s.length(); i++){
			char c = s.charAt(i);
			if(map.containsKey(c)){
				map.put(c, map.get(c) + 1);
			}else{
				map.put(c, 1);
			}
		}
		ArrayList<Card> list = new ArrayList<>();
		for(char key : map.keySet())
			list.add(new Card(key, map.get(key)));
		
		Collections.sort(list, new Comparator<Card>(){

			@Override
			public int compare(Card c1, Card c2){
				int a = c1.freq;
				int b = c2.freq;
				return a - b;
			}
		});
		int i = 0;
		long ans = 0l;
		while(i < list.size() && n > 0){
			Card obj = list.get(list.size() - i - 1);
			if(obj.freq < n){
				long u = obj.freq;
				ans = ans + u * u;
				n = n - obj.freq;
			}else{
				long p = n;
				ans = ans + p * p;
				n = 0;
			}
			i = i + 1;
		}
		System.out.println(ans);
		//System.out.println(kString(s, k));
		
		/*BufferedWriter wr = new BufferedWriter(new FileWriter(new File("output.txt")));
		HashMap<String, Integer> lookup = new HashMap<>();
		int n = Integer.parseInt(br.readLine());
		int m = 2*n;
		int ans[] = new int[m];
		String st = null;
		int j = 0;
		while((st = br.readLine()) != null){
			String data[] = st.split(" ");
			for(int i = 0; i < data.length; i++){
				if(!lookup.containsKey(data[i])){
					lookup.put(data[i], i + 1);
				}else{
					ans[j++] = lookup.get(data[i]);
					ans[j++] = i + 1;
					lookup.remove(data[i]); 
				}
			}
		}
		
		if(!lookup.isEmpty()){
			wr.write("-1");
		}else{
			j = 0;
			while(j < m - 2){
				wr.write(ans[j] + " " + ans[j + 1]+"\n");
				j = j + 2;
			}
			wr.write(ans[j] + " " + ans[j + 1]);
		}
		br.close();
		wr.close();
		*/
	}
}