Problem: You are given two strings s and t consisting of lowercase Latin letters. The length of t is 2 (i.e. this string consists only of two characters).

In one move, you can choose any character of s and replace it with any lowercase Latin letter. More formally, you choose some i and replace s_i (the character at the position i) with some character from 'a' to 'z'.

You want to do no more than k replacements in such a way that maximizes the number of occurrences of t in s as a subsequence.

Recall that a subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements.

Input

The first line of the input contains two integers n and k (2 ≤ n ≤ 200; 0 ≤ k ≤ n) — the length of s and the maximum number of moves you can make. The second line of the input contains the string s consisting of n lowercase Latin letters. The third line of the input contains the string t consisting of two lowercase Latin letters.

Output

Print one integer — the maximum possible number of occurrences of t in s as a subsequence if you replace no more than k characters in s optimally.

Examples

Input


4 2
bbaa
ab


Output


3


Input


7 3
asddsaf
sd


Output


10


Input


15 6
qwertyhgfdsazxc
qa


Output


16


Input


7 2
abacaba
aa


Output


15

Note

In the first example, you can obtain the string "abab" replacing s_1 with 'a' and s_4 with 'b'. Then the answer is 3.

In the second example, you can obtain the string "ssddsdd" and get the answer 10.

In the fourth example, you can obtain the string "aaacaaa" and get the answer 15.

Solution (in JAVA):

Solution:
/* package codechef; // don't place package name! */

import java.util.*;


import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Test
{
    public static int equal(char s[],char a,int k){
        int cnt = 0;
        for(char c : s)
        {
            if(a == c)
                cnt++;
        }
        int ans = Math.min(s.length,cnt+k);
        return (ans-1)*ans/2;
    }
    //notEqual[i][k][c] == till i index maximum number of subsequence with c number of a occures befor i index
    public static int notEqual(char s[],int i,int c,int k,char a,char b,int dp[][][]){
        if(i == s.length)
            return 0;
        if(dp[i][k][c] != -1)
            return dp[i][k][c];
        if(k == 0){
            if(s[i] == a)
                return dp[i][k][c] = notEqual(s, i+1, c+1, k, a, b,dp);
            if(s[i] == b)
                return dp[i][k][c] = c+notEqual(s, i+1, c, k, a, b,dp);
            return dp[i][k][c] = notEqual(s, i+1, c, k, a, b,dp);
        }
        if(s[i] == a)
            return dp[i][k][c] = Math.max(notEqual(s, i+1, c+1, k, a, b,dp),notEqual(s, i+1, c, k-1, a, b,dp)+c);
        if(s[i] == b)
            return dp[i][k][c] = Math.max(notEqual(s, i+1, c, k, a, b, dp)+c,notEqual(s, i+1, c+1, k-1, a, b,dp));
        
        int ca = notEqual(s, i+1, c+1, k-1, a, b,dp);
        int cb = c+notEqual(s, i+1, c, k-1, a, b,dp);
        int co = notEqual(s, i+1, c, k, a, b,dp);
        return dp[i][k][c] = Math.max(Math.max(co, ca),cb);
        
    }
 
	public static void main (String[] args) throws Exception {
		//code
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s[] = in.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        int k = Integer.parseInt(s[1]);
        String ss = in.readLine();
        String t = in.readLine();
        int dp[][][] = new int[n+1][k+1][n+1]; 
        for(int a[][] : dp){
            for(int b[]:a)
                Arrays.fill(b, -1);
        }
        char a = t.charAt(0);
        char b = t.charAt(1);
        if(a == b)
            System.out.println(equal(ss.toCharArray(),a,k));
        else
            System.out.println(notEqual(ss.toCharArray(), 0, 0, k, a, b,dp));
           
        
    }
}