1107_C. Brutality
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.
```python
# cook your dish here
#import sys
#sys.setrecursionlimit(10**9) 
ll=lambda:map(int,input().split())
t=lambda:int(input())
ss=lambda:input()
lx=lambda x:map(int,input().split(x))
yy=lambda:print("YES")
nn=lambda:print("NO")

from math import log10 ,log2,ceil,factorial as fac,gcd,inf,sqrt,log
#from itertools import combinations_with_replacement as cs 
#from functools import reduce
from bisect import bisect_right as br,bisect_left as bl
from collections import Counter
#from math import inf


mod=10**9+7


            
#for _ in range(t()):
def f():
    
    
    n,m=ll()
    a=list(ll())
    s=ss()

    su=0
    i=0
    while i<n:
        temp=[a[i]]
        for j in range(i,n-1):
            if s[j+1]==s[j]:
                temp.append(a[j+1])
    
            else:
                i=j+1
                break
        else:
            i=n
        #print(i,s[i],temp,su,j)
        
        
        temp.sort(reverse=1)
        su+=sum(temp[:m])
    print(su)
    
        
        
                
    
    
    
                
        
    
f()
    

'''

baca

bac
1 2 3
baaccca

abbaccccaba
 
'''

```