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

public class Main {
	static int N, K;
	static char[] ch;
	static char a, b;
	static int[][][] dp; // [idx][# of char a before idx][# of changes left]
	static int aCnt = 0;
	// give me 5 more minutes and i could've got AC during contest cause of this stupid edge case and some careless error
	
	public static void main(String[] args) throws IOException {
		N = in.iscan(); K = in.iscan();
		ch = in.sscan().toCharArray();
		String tmp = in.sscan();
		a = tmp.charAt(0); b = tmp.charAt(1);
		for (int i = 0; i < N; i++) {
			if (ch[i] == a) aCnt++;
		}
		if (a == b) {
			aCnt = Math.min(N, aCnt+K);
			out.println(aCnt*(aCnt-1)/2);
			out.close();
			System.exit(0);
		}
		dp = new int[N][N][K+1];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k <= K; k++) {
					dp[i][j][k] = -1;
				}
			}
		}
		out.println(attack(0, 0, K));
		out.close();
	} 
	
	static int attack(int idx, int cntA, int kLeft) {
		if (idx == N) return 0;
		if (dp[idx][cntA][kLeft] != -1) return dp[idx][cntA][kLeft];
		int ret = 0;
		if (ch[idx] == a) {
			// make current character char at 0
			ret = Math.max(ret, attack(idx+1, cntA+1, kLeft));
			// make current character char at 1
			if (kLeft > 0) ret = Math.max(ret, cntA + attack(idx+1, cntA, kLeft-1));
			// make current character something else
			if (kLeft > 0) ret = Math.max(ret, attack(idx+1, cntA, kLeft-1));
		}
		else if (ch[idx] == b) {
			// make current character char at 0
			if (kLeft > 0) ret = Math.max(ret, attack(idx+1, cntA+1, kLeft-1));
			// make current character char at 1
			ret = Math.max(ret, cntA + attack(idx+1, cntA, kLeft));
			// make current character something else
			if (kLeft > 0) ret = Math.max(ret, attack(idx+1, cntA, kLeft-1));
		}
		else {
			// make current character char at 0
			if (kLeft > 0) ret = Math.max(ret, attack(idx+1, cntA+1, kLeft-1));
			// make current character char at 1
			if (kLeft > 0) ret = Math.max(ret, cntA + attack(idx+1, cntA, kLeft-1));
			// make current character something else
			if (kLeft > 0) ret = Math.max(ret, attack(idx+1, cntA, kLeft-1));
			// leave current character the same
			ret = Math.max(ret, attack(idx+1, cntA, kLeft));
		}
		return dp[idx][cntA][kLeft] = ret;
	}
	
	static INPUT in = new INPUT(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	private static class INPUT {

		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar, numChars;

		public INPUT (InputStream stream) {
			this.stream = stream;
		}

		public INPUT (String file) throws IOException {
			this.stream = new FileInputStream (file);
		}

		public int cscan () throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read (buf);
			}
			
			if (numChars == -1)
				return numChars;

			return buf[curChar++];
		}

		public int iscan () throws IOException {
			int c = cscan (), sgn = 1;
			
			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			int res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public String sscan () throws IOException {
			int c = cscan ();
			
			while (space (c))
				c = cscan ();

			StringBuilder res = new StringBuilder ();

			do {
				res.appendCodePoint (c);
				c = cscan ();
			}
			while (!space (c));

			return res.toString ();
		}

		public double dscan () throws IOException {
			int c = cscan (), sgn = 1;
			
			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			double res = 0;

			while (!space (c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * UTILITIES.fast_pow (10, iscan ());
				
				res *= 10;
				res += c - '0';
				c = cscan ();
			}

			if (c == '.') {
				c = cscan ();
				double m = 1;

				while (!space (c)) {
					if (c == 'e' || c == 'E')
						return res * UTILITIES.fast_pow (10, iscan ());

					m /= 10;
					res += (c - '0') * m;
					c = cscan ();
				}
			}

			return res * sgn;
		}

		public long lscan () throws IOException {
			int c = cscan (), sgn = 1;
			
			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			long res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public boolean space (int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}

	public static class UTILITIES {

		static final double EPS = 10e-6;

		public static int lower_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] >= x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static int upper_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] > x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static long gcd (long a, long b) {
			return b == 0 ? a : gcd (b, a % b);
		}

		public static long lcm (long a, long b) {
			return a * b / gcd (a, b);
		}

		public static long fast_pow_mod (long b, long x, int mod) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow_mod (b * b % mod, x / 2, mod) % mod;

			return b * fast_pow_mod (b * b % mod, x / 2, mod) % mod;
		}

		public static int fast_pow (int b, int x) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow (b * b, x / 2);

			return b * fast_pow (b * b, x / 2);
		}

		public static long choose (long n, long k) {
			k = Math.min (k, n - k);
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = val * (n - i) / (i + 1);

			return val;
		}

		public static long permute (int n, int k) {
			if (n < k) return 0;
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = (val * (n - i));

			return val;
		}
	}
}
