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.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class tr1 {
	static PrintWriter out;
	static StringBuilder sb;
	static int n, z, k;
	static long mod = (long) 1e9 + 7;
	static int[][][] memo;
	static String s, t;
	static int[][] ad;
	static TreeMap<Long, Integer>[] gs;
	static long inf = Long.MAX_VALUE;
	static int[] color;
	static ArrayList<Integer> o;
	static char[][] g;
	static boolean[] vis, vis1;
	static long[] f;
	static int[] a;
	static int lj;
	static int[][] mat;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		n = sc.nextInt();
		k = sc.nextInt();
		s = sc.nextLine();
		t = sc.nextLine();
		memo = new int[n + 1][k + 1][n + 1];
		for (int[][] hh : memo)
			for (int[] h : hh)
				Arrays.fill(h, -1);
		System.out.println(dp(0, k, 0));
		out.flush();
	}

	static int dp(int i, int mov, int fc) {
		if (mov < 0)
			return Integer.MIN_VALUE;
		if (i == n)
			return 0;
		if (memo[i][mov][fc] != -1)
			return memo[i][mov][fc];
		int ans = 0;
		if (s.charAt(i) == t.charAt(0) && s.charAt(i) == t.charAt(1))
			ans = dp(i + 1, mov, fc + 1) + fc;
		if (s.charAt(i) == t.charAt(0) && s.charAt(i) != t.charAt(1)) {
			ans = Math.max(ans, dp(i + 1, mov, fc + 1));
			if (t.charAt(0) == t.charAt(1))
				ans = Math.max(ans, dp(i + 1, mov - 1, fc + 1) + fc);
			else
				ans = Math.max(ans, dp(i + 1, mov - 1, fc) + fc);
		}
		if (s.charAt(i) != t.charAt(0) && s.charAt(i) == t.charAt(1)) {
			ans = Math.max(ans, dp(i + 1, mov, fc) + fc);
			if (t.charAt(0) == t.charAt(1))
				ans = Math.max(ans, dp(i + 1, mov - 1, fc + 1) + fc);
			else
				ans = Math.max(ans, dp(i + 1, mov - 1, fc + 1));
		}
		if (s.charAt(i) != t.charAt(0) && s.charAt(i) != t.charAt(1)) {
			ans = Math.max(ans, dp(i + 1, mov, fc));
			if (t.charAt(0) == t.charAt(1))
				ans = Math.max(ans, dp(i + 1, mov - 1, fc + 1) + fc);
			else {
				ans = Math.max(ans, dp(i + 1, mov - 1, fc + 1));
				ans = Math.max(ans, dp(i + 1, mov - 1, fc) + fc);
			}
		}
		return memo[i][mov][fc] = ans;
	}

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

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

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

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