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 Ana {
	static char a, b, arr[];
	static int n, memo[][][], INF = (int) 1e9;

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		n = sc.nextInt();
		int k = sc.nextInt();
		arr = sc.next().toCharArray();
		String s2 = sc.next();
		a = s2.charAt(0);
		b = s2.charAt(1);
		if (a == b) {
			int cnt = k;
			for (int i = 0; i < n; i++)
				if (arr[i] == a)
					cnt++;
			cnt = Math.min(cnt, n);
			out.println(cnt * (cnt - 1) / 2);
		} else {
			memo = new int[n + 1][n + 1][n + 1];
			for (int i = 0; i <= n; i++)
				for (int j = 0; j <= n; j++)
					Arrays.fill(memo[i][j], -1);
			int ans = 0;
			for (int cnt = 0; cnt <= n; cnt++) {
//				System.out.println(dp(0, k, cnt));
				ans = Math.max(ans, dp(0, k, cnt));

			}
			out.println(ans);
		}
		out.close();
	}

	static int dp(int i, int k, int bcnt) {
		if (bcnt < 0 || k < 0)
			return -INF;
		if (i == n) {
			return (bcnt == 0 ? 0 : -INF);

		}
		if (memo[i][k][bcnt] != -1)
			return memo[i][k][bcnt];
		int ans = -INF;
		int gain = 0;
		if (arr[i] == a) {
			gain = bcnt;

		}
		ans = Math.max(ans, gain + dp(i + 1, k, arr[i] == b ? bcnt - 1 : bcnt));
		// set arr[i] = b
		ans = Math.max(ans, dp(i + 1, k - 1, bcnt - 1));
		// set arr[i] = a
		ans = Math.max(ans, bcnt + dp(i + 1, k - 1, bcnt));
//		System.out.println(i+" "+k+" "+bcnt + " "+ans);
		return memo[i][k][bcnt] = ans;
	}

	static class Pair {
		int i, j;

		Pair(int x, int y) {
			i = x;
			j = y;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(s));
		}

		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 int[] nextIntArray(int n) throws IOException {
			int[] ans = new int[n];
			for (int i = 0; i < n; i++)
				ans[i] = nextInt();
			return ans;
		}

		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 boolean ready() throws IOException {
			return br.ready();
		}

	}
}