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.*;import java.math.*;import java.lang.*;




public class second
{
    
    static Map<Integer,Integer> map;
    static int m = 1000000007;
    public static void process()throws IOException
    {
            long n=nl();
            long k=nl();
            String s=nln();

            long a[] = new long[27];
            ArrayList<Long> set = new ArrayList<Long>();
            TreeSet<Character> ch = new TreeSet<Character>();

            char c[] = s.toCharArray();
            for(int i=0;i<s.length();i++)
            {
                   a[c[i]-'A'+1]++;
                   // p(c[i]+"   ");
                   // p(c[i]-'A'+1+"    ");
                   // pn(a[c[i]-'A'+1]);
                   ch.add(c[i]);
            }

            for(Character i : ch)
            {
                  set.add(a[i-'A'+1]);
            }

            long sum=0;

            Collections.sort(set,Collections.reverseOrder());


            
           // pn(set);
            for(Long i : set)
            {
                   if(k>=i)
                   {
                           sum+=(i*i);
                           k=k-i;
                   }
                   else
                   {
                          sum+=(k*k);
                          k=0;
                          break;
                   }
            }
            //if(k==0)
            //{

                 pn(sum);
            //}
            //else
            //{
            //       sum+=k;
            //       pn(sum);
            //}



    }   
    
           
   

    
               
      

    



    
    

  
    

            
           
    




    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

        // oj = System.getProperty("ONLINE_JUDGE") != null;
        // if(!oj) sc=new AnotherReader(100);

       long s = System.currentTimeMillis();
         int t=1;//test cases
         while(t-->0)
            process();
        out.flush();
        // if(!oj)
        //   System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;



/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader
    {
        BufferedReader br; StringTokenizer st;
        AnotherReader()throws FileNotFoundException
        {
              br=new BufferedReader(new InputStreamReader(System.in));
        }
        AnotherReader(int a)throws FileNotFoundException
        {
              br = new BufferedReader(new FileReader("input.txt"));
        }
        String next()throws IOException
        {
              while (st == null || !st.hasMoreElements()) 
                {
                    try
                     {
                               st = new StringTokenizer(br.readLine());
                     }
                    catch (IOException  e)
                    {
                               e.printStackTrace(); 
                     }
                }
                return st.nextToken(); 
        }
        int nextInt() throws IOException
        {
                return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {  
                return Long.parseLong(next());
        }
        double nextDouble()throws IOException 
        { 
               return Double.parseDouble(next()); 
        }
        String nextLine() throws IOException
        { 
               String str = ""; 
               try
               {
                     str = br.readLine();
               }
               catch (IOException e)
               {
                          e.printStackTrace();
               } return str;
        }
    }
    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
    
    
    
    