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

public class F_1409 {
	
	static int INF = (int)1e9+7;
	static int n;
	static String str;
	static char s, t;
	static int[][][] memo;
	
	public static int dp(int i, int rem, int prev) {
		if(rem < 0)
			return -INF;
		if(i == n)
			return 0;
		
		if(memo[i][rem][prev] != -1)
			return memo[i][rem][prev];
		
		if(s == t) {
			if(str.charAt(i) != s) {
				return memo[i][rem][prev] = Math.max(prev + dp(i + 1, rem - 1, prev + 1), dp(i + 1, rem, prev));
			} else {
				return memo[i][rem][prev] = prev + dp(i + 1, rem, prev + 1);
			}
		} else {
			if(str.charAt(i) != s && str.charAt(i) != t) {
				if(prev == 0) {
					return memo[i][rem][prev] = Math.max(dp(i + 1, rem - 1, 1), dp(i + 1, rem, 0));
				} else {
					return memo[i][rem][prev] = Math.max(prev + dp(i + 1, rem - 1, prev), Math.max(dp(i + 1, rem, prev), dp(i + 1, rem - 1, prev + 1)));
				}
			} else if(str.charAt(i) == s) {
				if(prev == 0) {
					return memo[i][rem][prev] = dp(i + 1, rem, 1);
				} else {
					return memo[i][rem][prev] = Math.max(prev + dp(i + 1, rem - 1, prev), dp(i + 1, rem, prev + 1));
				}
			} else {
				if(prev == 0) {
					return memo[i][rem][prev] = Math.max(dp(i + 1, rem - 1, 1), dp(i + 1, rem, 0));
				} else {
					return memo[i][rem][prev] = Math.max(dp(i + 1, rem - 1, prev + 1), prev + dp(i + 1, rem, prev));
				}
			}
		}
	}
	
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		n = sc.nextInt();
		int k = sc.nextInt();
		str = sc.next();
		String x = sc.next();
		s = x.charAt(0);
		t = x.charAt(1);
		
		memo = new int[n][k + 1][n + 1];
		for(int[][] i : memo)
			for(int[] j : i)
				Arrays.fill(j, -1);
		
		pw.println(dp(0, k, 0));
		pw.flush();
	}

	public static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

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

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

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public int[] nextIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++)
				array[i] = nextInt();
			return array;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] array = new Integer[n];
			for (int i = 0; i < n; i++)
				array[i] = new Integer(nextInt());
			return array;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++)
				array[i] = nextLong();
			return array;
		}

		public double[] nextDoubleArray(int n) throws IOException {
			double[] array = new double[n];
			for (int i = 0; i < n; i++)
				array[i] = nextDouble();
			return array;
		}

		public static int[] shuffle(int[] a) {
			int n = a.length;
			Random rand = new Random();
			for (int i = 0; i < n; i++) {
				int tmpIdx = rand.nextInt(n);
				int tmp = a[i];
				a[i] = a[tmpIdx];
				a[tmpIdx] = tmp;
			}
			return a;
		}

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

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}