You are playing a new famous fighting game: Kortal Mombat XII. You have to perform a brutality on your opponent's character.

You are playing the game on the new generation console so your gamepad have 26 buttons. Each button has a single lowercase Latin letter from 'a' to 'z' written on it. All the letters on buttons are pairwise distinct.

You are given a sequence of hits, the i-th hit deals a_i units of damage to the opponent's character. To perform the i-th hit you have to press the button s_i on your gamepad. Hits are numbered from 1 to n.

You know that if you press some button more than k times in a row then it'll break. You cherish your gamepad and don't want to break any of its buttons.

To perform a brutality you have to land some of the hits of the given sequence. You are allowed to skip any of them, however changing the initial order of the sequence is prohibited. The total damage dealt is the sum of a_i over all i for the hits which weren't skipped.

Note that if you skip the hit then the counter of consecutive presses the button won't reset.

Your task is to skip some hits to deal the maximum possible total damage to the opponent's character and not break your gamepad buttons.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 2 ⋅ 10^5) — the number of hits and the maximum number of times you can push the same button in a row.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9), where a_i is the damage of the i-th hit.

The third line of the input contains the string s consisting of exactly n lowercase Latin letters — the sequence of hits (each character is the letter on the button you need to press to perform the corresponding hit).

Output

Print one integer dmg — the maximum possible damage to the opponent's character you can deal without breaking your gamepad buttons.

Examples

Input


7 3
1 5 16 18 7 2 10
baaaaca


Output


54


Input


5 5
2 4 1 3 1000
aaaaa


Output


1010


Input


5 4
2 4 1 3 1000
aaaaa


Output


1009


Input


8 1
10 15 2 1 4 8 15 16
qqwweerr


Output


41


Input


6 3
14 18 9 19 2 15
cccccc


Output


52


Input


2 1
10 10
qq


Output


10

Note

In the first example you can choose hits with numbers [1, 3, 4, 5, 6, 7] with the total damage 1 + 16 + 18 + 7 + 2 + 10 = 54.

In the second example you can choose all hits so the total damage is 2 + 4 + 1 + 3 + 1000 = 1010.

In the third example you can choose all hits expect the third one so the total damage is 2 + 4 + 3 + 1000 = 1009.

In the fourth example you can choose hits with numbers [2, 3, 6, 8]. Only this way you can reach the maximum total damage 15 + 2 + 8 + 16 = 41.

In the fifth example you can choose only hits with numbers [2, 4, 6] with the total damage 18 + 19 + 15 = 52.

In the sixth example you can change either first hit or the second hit (it does not matter) with the total damage 10.


//
//import javax.print.DocFlavor;
//import javax.swing.*;
//import javax.swing.text.StyleContext;
//import java.awt.image.AreaAveragingScaleFilter;
import javax.print.attribute.Attribute;
import javax.print.attribute.HashAttributeSet;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.nio.channels.AcceptPendingException;
import java.nio.charset.IllegalCharsetNameException;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Collections;
import java.io.InputStreamReader;
import java.util.logging.SimpleFormatter;


public   class Main{





    public static void main(String[] args) {

        try {
            PrintWriter fop = new PrintWriter(System.out);
             FastScanner fsca = new FastScanner();

            int n = fsca.nextInt();
            int k = fsca.nextInt();

            int A[] = fsca.readArray(n);
            char ch[] = fsca.next().toCharArray() ;

            PriorityQueue<Integer> pq = new PriorityQueue<>() ;
            long sum = A[0] ;
            pq.add(A[0]) ;

            for (int i = 1; i <n ; i++) {
                if (ch[i] != ch[i-1])
                    pq.clear();

                sum += A[i] ;
                pq.add(A[i]);
                if (pq.size() > k) {
                    sum -= pq.poll() ; }


            }
            fop.println(sum);


















//        int tree[] = new int[4*n+1] ;
//        BuiltTree(A , 0 , n-1 , tree , 1);
//        int lazy[] = new int[4*n + 1] ;
//
//        updateRangeLazy(tree , lazy , 0 , n-1 , 0 , 2 , 10 , 1);
//        updateRangeLazy(tree , lazy , 0 , n-1 , 0 , 4 , 10 , 1);
//
//        fop.println(querylazy(tree , lazy , 0 , n-1 , 1 ,1 ,1));
//
//        updateRangeLazy(tree, lazy , 0 , n-1 , 10 , 4 , 3 ,1);
//        fop.println(querylazy(tree , lazy , 0 , n-1 , 3 , 5 , 1 ));


            fop.flush();
            fop.close();

        }
        catch (Exception e){
            return;
        }



    }
    /*-----------------------------------------------------------------------------------------------------------------------------------------------*/

    // segment tree


    //  BuiltTree(A , 0 , n-1 , tree , 1);
    static void BuiltTree(int A[] , int s , int e , int tree[] , int index){
        if (s== e) {
            tree[index] = A[s] ;
            return;
        }

        int mid = (s+e)/2;
        BuiltTree(A , s , mid , tree , 2*index);
        BuiltTree(A , mid+1 , e , tree , 2*index+1);
        tree[index] = Math.min( tree[2*index], tree[2*index+1] ) ;
        return;

    }

    static int query(int tree[] , int ss , int se , int qs , int qe , int index){

        // complete overlap
        if (ss >= qs && se <= qe)
            return  tree[index];

        //no overlap
        if (qe < ss || qs > se)
            return Integer.MAX_VALUE ;

        // partial overlap
        int mid = (ss+se)/2 ;
        int left = query(tree , ss , mid , qs, qe , 2*index) ;
        int right = query(tree , mid+1 , se , qs, qe , 2*index+1) ;
        return Math.min(left , right) ;
    }


   static void update(int tree[] , int ss , int se , int i , int increment , int index){
        // i is the index of which we want to update the value

        if (i > se || i<ss)
            return;

        if (ss == se){
              tree[index] += increment ;
            return;
        }
        int mid = (ss+se)/2 ;
        update(tree , ss , mid , i , increment , 2*index);
        update(tree , mid+1 , se , i , increment , 2*index+1);
        tree[index]  = Math.min(tree[2*index], tree[2*index+1] ) ;

    }

    static  void updateRange(int tree[] , int ss , int se , int l , int r , int inc , int index){

        if (l > se || r< ss)
            return;

        if (ss == se){
            tree[index] += inc ;
             return;
        }

        int mid = (ss+se)/2 ;
        updateRange(tree , ss , mid , l , r , inc , 2*index);
        updateRange(tree , mid+1 , se , l , r , inc , 2*index + 1);

        tree[index] = Math.min( tree[2*index], tree[2*index + 1] ) ;
        return;


    }
    // Lazy rnage Update

    static void updateRangeLazy(int tree[] , int lazy[] , int ss ,int se , int l , int r , int increment , int index){

        if (lazy[index] != 0 ){
            tree[index] += lazy[index];

            if (ss != se){
                lazy[2*index]  +=  lazy[index];
                lazy[2*index + 1]  +=  lazy[index];
            }
            lazy[index ] = 0 ;
        }

        if (ss > r && se< l )
            return;

        if (ss >= l && se <= r) {
            tree[index] += increment;


            if (ss != se) {
                lazy[2 * index] += increment;
                lazy[2 * index + 1] += increment;
            }
            return;
        }

        int mid = (ss + se)/2 ;
        updateRange(tree , ss , mid , l , r , increment , 2*index);
        updateRange(tree , mid + 1 , se , l , r , increment , 2*index + 1);

        tree[index] =  Math.min( tree[2*index], tree[2*index + 1] ) ;

    }

    // min lazy query

    static int querylazy(int tree[] , int lazy[] , int ss , int se , int qs , int qe , int index) {

        if (lazy[index] != 0) {

            tree[index] += lazy[index];
            if (ss != se) {
                lazy[2 * index] += lazy[index];
                lazy[2 * index + 1] += lazy[index];
            }
            lazy[index] = 0;
        }

        if (ss > qe || se < qs)
            return Integer.MAX_VALUE;

        if (ss >= qs && se <= qe)
            return tree[index];

        int mid = (ss + se) / 2;
        int left = querylazy(tree, lazy, ss, mid, qs, qe, 2 * index);
        int right = querylazy(tree, lazy, mid + 1, se, qs, qe, 2 * index + 1);

        return Math.min(left, right);

    }





/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
    static boolean isEven(int a){
        if (a%2 == 0)
            return true ;
        else return false ;
    }
    static boolean isEvenLong(long a){
        if (a%2 == 0)
            return true ;
        else return false ;
    }

    static void sieve(int n){
        boolean[] flag = new boolean[n] ;

        for (int i=2 ; i*i<n ; i++){
            if (flag[i])
                continue;
            else
                for (int j= i*i ; j<=n ; j+= i){
                    flag[j] = true;
                }
        }


    }
    static int gcd(int a , int b){
        if (b > a){
            int tenp = b ;
            b = a ;
            a = tenp ;
        }
        int temp = 0 ;
        while (b != 0){
            a %= b ;
            temp = b ;
            b = a ;
            a = temp ;
        }
        return a ;
    }

    static long gcd1( long a , long b){
        if (b > a){
            long tenp = b ;
            b = a ;
            a = tenp ;
        }
        long temp = 0 ;
        while (b != 0){
            a %= b ;
            temp = b ;
            b = a ;
            a = temp ;
        }
        return a ;
    }






    static final Random random=new Random();

    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }




    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long[] readLongArray(int n){
            long[] a = new long[n];
            for (int i=0 ; i<n ; i++)
                a[i] = nextLong() ;
            return a ;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }






}


