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

public class Sample
{

	static long[][][] dp;
	static int[] are;

	public static void main(String[] args) throws InterruptedException {
		Thread t=new Thread(null, null,"", 1<<28) {
			public void run() {
				m();
			}
		};
		t.start();
		t.join();
	}

	static long[] ten = new long[20];

	public static void m()
	{
		FastScanner in = new FastScanner();
		int n = in.nextInt();
		int k = in.nextInt();
		String x = in.next();
		String str = in.next();
		String a = str.substring(0, 1);
		String b = str.substring(1, 2);
		//
		if(a.equals(b))
		{
			int count=0;
			for(int i=0; i<n; i++) if(x.substring(i,i+1).equals(a)) count++;
			count+=k;
			count=Math.min(count, n);
			System.out.println((long)count*(count-1)/2);
			return;
		}
		dp = new long[n+1][n+1][k+1];
		for(int i=0; i<=n; i++)
		{
			for(int j=0; j<=n; j++)
			{
				Arrays.fill(dp[i][j], -1);
			}
		}
		System.out.println(juice(x, a, b, 1, 0, k));
	}

	static long juice(String x, String a, String b, int position, int count, int left)
	{
		if(position>x.length()) return 0;
		if(dp[position][count][left]!=-1) return dp[position][count][left];

		long ans = 0;

		//do nothing
		ans = Math.max(ans, juice(x, a, b, position+1, count, left));

		//change to a
		int change = x.substring(position-1, position).equals(a) ? 0 : 1;
		if(change<=left) ans = Math.max(ans, juice(x, a, b, position+1, count+1, left-change));

		//change to b
		change = x.substring(position-1, position).equals(b) ? 0 : 1;
		if(change<=left) ans = Math.max(ans, count+juice(x, a, b, position+1, count, left-change));

		//
		dp[position][count][left]=ans;
		return dp[position][count][left];
	}

	static int sum(long n)
	{
		int res=0;
		String x = String.valueOf(n);
		for(int i=1; i<=x.length(); i++) res+=digit(n, i);
		return res;
	}

	static long digit(long n, int i)
	{
		return (long)(n/ten[i-1])%10;
	}

/*
1
5
01101
10101

*/

	static void print(String[] are)
	{
		for(int i=0; i<are.length; i++)
			System.out.print(are[i]);
		System.out.println();
	}

	static void sort(int[] a)
	{
		ArrayList<Integer> list=new ArrayList<>();
		for (int i:a) list.add(i);
		Collections.sort(list);
		for (int i=0; i<a.length; i++) a[i]=list.get(i);
	}

	static class FastScanner
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}

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

		public ArrayList<Integer> readArray(int n) {
			ArrayList<Integer> a=new ArrayList<>();
			for (int i=0; i<n; i++) a.add(nextInt());
			return a;
		}

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

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

}