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.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;

import javax.net.ssl.SSLContext;

public class Main {
	
  static BufferedReader in;
  static PrintWriter out;
  static StringTokenizer tok;
  static int hm[] = null;

  static long[][] result;
  static int max;
  static int length;
  
  static void solve() throws Exception {
	  
	  int n = nextInt();
	  int k = nextInt();
	  
	  String s = nextLine();
	  
	  int values[] = new int[256];
	  for(int i = 0 ; i < s.length() ; i++) {
		  values['a'- s.charAt(i)]++;
	  }
	  Arrays.sort(values);
	  
	  long res = 0;
	  int change = 0;
	  
	  for(int i = values.length-1 ; i > 0 ;i--) {
		  if(values[i] >= k) {
			  res += (long)k*k;
			  k = 0;
		  } else if(values[i] > 0) {
			  res += (long)values[i]*values[i];
			  k -= values[i];
		  } else {
			  break;
		  }
		  
		  if( k <=0) {
			  break;
		  }
	  }
	  
	  System.out.println(res);
  }
  
  
  
  
  	
	static private long calculate(int step, int number) {
		if (result[step][number] != -1)
			return result[step][number];
		if (step == length)
			return result[step][number] = 1;
		result[step][number] = 0;
		for (int i = number; i <= max; i += number)
			result[step][number] += calculate(step + 1, i);
		return result[step][number] %= (int)(1e9 + 7);
	}

  static class ArrayUtils {

		public static void fill(long[][] array, long value) {
			for (long[] row : array)
				Arrays.fill(row, value);
		}

		public static void fill(int[][] array, int value) {
			for (int[] row : array)
				Arrays.fill(row, value);
			
		}

		}
  
  

  public static void main(String args[]) {
    try {
      in = new BufferedReader(new InputStreamReader(System.in));
      out = new PrintWriter(new OutputStreamWriter(System.out));
      solve();
      in.close();
      out.close();
    } catch (Throwable e) {
      e.printStackTrace();
      System.exit(1);
    }
  }

  static int nextInt() throws IOException {
    return Integer.parseInt(next());
  }
  
  public static int[] readIntArray(int size) throws IOException {
      int[] result = new int[(int) size];
      for (int i = 0; i < size; i++) {
          result[(int) i] = (int)nextInt();
      }
      return result;
  }


  static int[] nextIntArray(int len, int start) throws IOException {
    int[] a = new int[len];
    for (int i = start; i < len; i++)
      a[i] = nextInt();
    return a;
  }

  static long nextLong() throws IOException {
    return Long.parseLong(next());
  }

  static long[] nextLongArray(int len, int start) throws IOException {
    long[] a = new long[len];
    for (int i = start; i < len; i++)
      a[i] = nextLong();
    return a;
  }

  static double nextDouble() throws IOException {
    return Double.parseDouble(next());
  }

  static double[] nextDoubleArray(int len, int start) throws IOException {
    double[] a = new double[len];
    for (int i = start; i < len; i++)
      a[i] = nextDouble();
    return a;
  }

  static BigInteger nextBigInteger() throws IOException {
    return new BigInteger(next());
  }

  static String next() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      tok = new StringTokenizer(in.readLine());
    }
    return tok.nextToken();
  }

  static String nextLine() throws IOException {
    tok = new StringTokenizer("");
    return in.readLine();
  }

  static void shuffleArray(long[] array) {
    Random random = new Random();
    for (int i = array.length - 1; i > 0; i--) {
      int index = random.nextInt(i + 1);
      long temp = array[index];
      array[index] = array[i];
      array[i] = temp;
    }
  }

  static boolean hasNext() throws IOException {
    while (tok == null || !tok.hasMoreTokens()) {
      String s = in.readLine();
      if (s == null) {
        return false;
      }
      tok = new StringTokenizer(s);
    }
    return true;
  }
  

}