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:
import java.io.*;
import java.math.*;
import java.util.*;

public class Main implements Runnable {

	int go(String s, String t, int n, int i, int k, int dp[][][], int countFirst){
		
		if(i==n+1)
			return 0;
		
		if(dp[i][k][countFirst] !=-1)
			return dp[i][k][countFirst];
		
		
		//replace
		//by 1st char
		int res1=0;
		if(k>=1)
			res1=go(s, t, n, i+1, k-1, dp, countFirst+1);
		//by 2nd char
		int res2=0;
		if(k>=1){
			res2=go(s, t, n, i+1, k-1, dp, countFirst)+countFirst;
		}
		if(k>=1 && t.charAt(2)==t.charAt(1))
			res2= Math.max(res2, go(s, t, n, i+1, k-1, dp, countFirst+1)+countFirst);
		//skip
		
		
		
		int res3=  go(s, t, n, i+1, k, dp, countFirst);
		if(t.charAt(2)==t.charAt(1)){
			if(t.charAt(1)==s.charAt(i)){
				res3= Math.max(res3, go(s, t, n, i+1, k, dp, countFirst+1)+countFirst);
			}
		}
		else{
			if(t.charAt(1)==s.charAt(i))
				res3= Math.max(res3, go(s, t, n, i+1, k, dp, countFirst+1));
			else if(t.charAt(2)==s.charAt(i))
				res3= Math.max(res3, go(s, t, n, i+1, k, dp, countFirst)+countFirst);
				
		}
		
		
		return dp[i][k][countFirst]=  Math.max(Math.max(res1, res2), res3);
	}
	

	public void solve() throws Exception {

		//int tt=iread();
		int tt=1;
		for(int cases=1;cases<=tt;cases++){
			int n= iread();
			int k= iread();
			
			String s= readword();
			String t= readword();
			s= "$"+s;
			t= "$"+t;
			
			int dp[][][]= new int[n+2][n+2][n+2];
			for(int i=0;i<=n;i++)
				for(int j=0;j<=k;j++)
					for(int l=0;l<=n;l++)
						dp[i][j][l]=-1;
			
			System.out.println(go(s, t, n, 1, k, dp, 0));
			
		}
	}




	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			// in = new BufferedReader(new FileReader(filename+".in"));
			// out = new BufferedWriter(new FileWriter(filename+".out"));
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int iread() throws Exception {
		return Integer.parseInt(readword());
	}

	public double dread() throws Exception {
		return Double.parseDouble(readword());
	}

	public long lread() throws Exception {
		return Long.parseLong(readword());
	}

	BufferedReader in;

	BufferedWriter out;

	public String readword() throws IOException {
		StringBuilder b = new StringBuilder();
		int c;
		c = in.read();
		while (c >= 0 && c <= ' ')
			c = in.read();
		if (c < 0)
			return "";
		while (c > ' ') {
			b.append((char) c);
			c = in.read();
		}
		return b.toString();
	}

	public static void main(String[] args) {

		try {
			Locale.setDefault(Locale.US);
		} catch (Exception e) {

		}
		// new Thread(new Main()).start();
		new Thread(null, new Main(), "1", 1 << 25).start();
	}
}