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.FileReader;
                import java.io.IOException;
                import java.io.InputStream;
                import java.io.InputStreamReader;
                import java.io.PrintWriter;
                import java.math.BigInteger;
                import java.util.*;
                    public class Hello {
                    	public static TreeSet<Long> primeFactors(long n)
                        {
                    		TreeSet<Long> res = new TreeSet<Long>();
                            // Print the number of 2s that divide n 
                        while (n % 2 == 0) { 
                            n /= 2;
                            res.add((long) 2);
                        } 
                        
                  
                        // n must be odd at this point.  So we can 
                    // skip one element (Note i = i +2) 
                    for (long i = 3; i <= Math.sqrt(n); i += 2) { 
                        // While i divides n, print i and divide n 
                            while (n % i == 0) { 
                                res.add((long)i);
                                n /= i; 
                            }
                        } 
                  
                        // This condition is to handle the case whien 
                    // n is a prime number greater than 2 
                    if (n > 2) 
                        res.add(n);
                    return res;
                }
                  static long power(long x, long y, long p) 
                    { 
                        // Initialize result 
                        long res = 1;      
                         
                        // Update x if it is more   
                    // than or equal to p 
                    x = x % p;  
                  
                    while (y > 0) 
                    { 
                        // If y is odd, multiply x 
                        // with result 
                        if((y & 1)==1) 
                            res = (res * x) % p; 
                  
                        // y must be even now 
                        // y = y / 2 
                    	            y = y >> 1;  
                    	            x = (x * x) % p;  
                    	        } 
                    	        return res; 
                    	    }
                  public static void f(int[] arr,int n,int[] primes,TreeSet<Integer>prime,StringBuilder res) {
                	  int t = Math.abs(arr[n]-n-1);int idx = 2;
                	  for(int i=0;i<primes.length && t>=primes[i];i++) {
                		  if(prime.contains(t-primes[i])) {
                			  idx = primes[i];
                			  break;
                		  }
                	  }
                	  //System.out.println(idx);
                	  if(arr[n]>n+1) {
                	  int tmp = arr[n];
                	  arr[n] = arr[n+idx-1];
                	  arr[n+idx-1] = tmp;
                	  res.append((n+1)+" " + (n+idx) + "\n");
                	  tmp = arr[n+idx-1];
                	  int tt = arr[n];
                	  arr[n+idx-1] = arr[tt-1];
                	  arr[tt-1] = tmp;
                	  res.append(n+idx + " " + (arr[n])+"\n");
                	  }else {
                    	  int tmp = arr[n];
                    	  arr[n] = arr[n-idx+1];
                    	  arr[n-idx+1] = tmp;
                    	  res.append((n+1)+" " + (n-idx) + "\n");
                    	  tmp = arr[n-idx+1];
                    	  int tt = arr[n];
                    	  arr[n-idx+1] = arr[tt-1];
                    	  arr[tt-1] = tmp;
                    	  res.append(n-idx + " " + (arr[n])+"\n");
                	  }
                		
                  }
                  
                	    static PrintWriter pw = new PrintWriter(System.out);
                	public static void main(String[] args) throws IOException {
                		Scanner sc = new Scanner(System.in);
                		int n = sc.nextInt();
                		long m = sc.nextInt();
                		String s = sc.next();
                		int[] arr = new int[n];
                		int[] count = new int[26];
                		for(int i=0;i<n;i++) {
                			count[s.charAt(i)-'A']++;
                		}
                		PriorityQueue<card> p = new PriorityQueue<card>(Collections.reverseOrder());
                		for(int i=0;i<count.length;i++) {
                			if(count[i]!=0) {
                				card t = new card(i,count[i]);
                				p.add(t);
                			}
                		}
                		long res = 0;
                		while(!p.isEmpty()&&m>0) {
                			long t = p.poll().n;
                			if(t>=m) {
                				res+=m*m;
                				m = 0;
                			}else {
                				res += t*t;
                				m-=t;
                			}
                		}
                		pw.println(res);
                		pw.flush();
                		pw.close();
                	}
                }
                     class card implements Comparable<card>{
                    	int a; int n;
                    	public card(int x,int y) {
                    		a=x;n=y;
                    	}
                    	public int compareTo(card c) {
                    		if(n<c.n)return -1;
                    		if(n>c.n)return 1;
                    		return 0;
                    	}
                    }
                    class Scanner {
                        StringTokenizer st;
                        BufferedReader br;
                     
                        public Scanner(FileReader r) {
                            br = new BufferedReader(r);
                        }
                     
                        public Scanner(InputStream s) {
                            br = new BufferedReader(new InputStreamReader(s));
                        }
                     
                        public String next() throws IOException {
                            while (st == null || !st.hasMoreTokens())
                                st = new StringTokenizer(br.readLine());
                            return st.nextToken();
                        }
                     
                        public int nextInt() throws IOException {
                            return Integer.parseInt(next());
                        }
                     
                        public long nextLong() throws IOException {
                            return Long.parseLong(next());
                        }
                     
                        public String nextLine() throws IOException {
                            return br.readLine();
                        }
                     
                        public double nextDouble() throws IOException {
                            String x = next();
                            StringBuilder sb = new StringBuilder("0");
                            double res = 0, f = 1;
                            boolean dec = false, neg = false;
                            int start = 0;
                            if (x.charAt(0) == '-') {
                                neg = true;
                                start++;
                            }
                            for (int i = start; i < x.length(); i++)
                                if (x.charAt(i) == '.') {
                                    res = Long.parseLong(sb.toString());
                                    sb = new StringBuilder("0");
                                    dec = true;
                                } else {
                                    sb.append(x.charAt(i));
                                    if (dec)
                                        f *= 10;
                                }
                            res += Long.parseLong(sb.toString()) / f;
                            return res * (neg ? -1 : 1);
                        }
                     
                        public boolean ready() throws IOException {
                            return br.ready();
                            
                        }
                    }