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.
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.io.*;

public class p6 {
	static char c1;
	static char c2;
	static char[] str;
	static int [][][]memo;
	public static void main(String[] args) throws NumberFormatException, IOException, InterruptedException {
		//System.out.println(fact(100));
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int k = sc.nextInt();
		str = sc.next().toCharArray();
		String d = sc.next();
		c1 = d.charAt(0);
		c2 = d.charAt(1);
		if(c1==c2) {
			int c=0;
			for (int i = 0; i < str.length; i++) {
				if(str[i]==c1)
					c++;
			}
			c=Math.min(str.length, c+k);
			if(c<2)
				System.out.println(0);
			else 
				 System.out.println((c-1)*c /2);
		}else {
			memo=new int [n+1][k+1][n+1];
			for (int[][] y : memo) {
				for (int[] x : y) {
					Arrays.fill(x, -1);
				}
			}
			System.out.println(solve(0, k, 0));
		}
		
	}

	static int solve(int idx, int remChange, int first) {
		if(memo[idx][remChange][first]!=-1)
			return memo[idx][remChange][first];
		if (idx == str.length)
			return memo[idx][remChange][first]=0;
		if (str[idx] == c1) {
			int nochange = solve(idx + 1, remChange, first + 1);
			int change2 = remChange==0 ?0:solve(idx + 1, remChange - 1, first) + first;
			return memo[idx][remChange][first]=Math.max(nochange, change2);
		} else if (str[idx] == c2) {
			int nochange = solve(idx + 1, remChange, first) + first;
			int change1 =remChange==0 ?0:solve(idx + 1, remChange - 1, first + 1);
			return memo[idx][remChange][first]=Math.max(nochange, change1);
		} else {
			int nochange = solve(idx + 1, remChange, first);
			int change1 =remChange==0 ?0: solve(idx + 1, remChange - 1, first + 1);
			int change2 =remChange==0 ?0: solve(idx + 1, remChange - 1, first) + first;
			return memo[idx][remChange][first]=Math.max(nochange, Math.max(change1, change2));
		}

	}
	static long nCr(int n, int r) 
	{ 
	    return fact(n) / ((fact(r) * fact(n - r))); 
	} 
	  
	// Returns factorial of n 
	static long fact(int n) 
	{ 
	    long res = 1; 
	    for (int i = 2; i <= n; i++) 
	        res = res * i; 
	    return res; 
	} 
	static void shuffleArray(int[] ar) {
		// If running on Java 6 or older, use `new Random()` on RHS here
		Random rnd = ThreadLocalRandom.current();
		for (int i = ar.length - 1; i > 0; i--) {
			int index = rnd.nextInt(i + 1);
			// Simple swap
			int a = ar[index];
			ar[index] = ar[i];
			ar[i] = a;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < arr.length; i++)
				arr[i] = nextInt();
			return arr;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}