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.

import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;


public class N667 {
	static PrintWriter out;
	static Scanner sc;
	static ArrayList<Integer>q,w,primes;
	static ArrayList<Integer>adj[];
	static HashSet<Integer>primesH;
	static boolean prime[];
	//static ArrayList<Integer>a;
	static HashSet<Long>h,tmp;
	static boolean[]v;
	static int[]a,b,c,d;
	static int dp[][][];
	static int A,B,n,m,k,mt[][];
	static int oo=Integer.MIN_VALUE;
	static String s,tt;
	public static void main(String[]args) throws IOException {
		sc=new Scanner(System.in);
		out=new PrintWriter(System.out);
		//A();
    	//B();
		//primes=new ArrayList<Integer>();
		//primesH=new HashSet<Integer>();
	//	sieveOfEratosthenes(50);
		//C();
		//D();
		//E();
		//minimum for subarrays of fixed length
		F();
		out.close();
	}
	  private static void A() throws IOException {
		  int t=ni();
			while(t-->0) {
				int a=sc.nextInt(),b=sc.nextInt();
				
				int diff=Math.abs(a-b);
				int num=diff/10;
				if(diff==0)out.println(0);
				else if(num==0) {
					out.println(1);
				}
				else {
					out.println((int)Math.ceil(diff/10.0));
				}
			}
		
	   }
		static void B() throws IOException {
			int t=ni();
			while(t-->0) {
				long a=ni(),b=ni(),x=ni(),y=ni(),n=ni();
				//n=Math.min(n, Math.min(x, y));
				long tmp1=a,tmp2=b,tmp3=n;
			//	if(a<b) {
					long diff=Math.max(0, tmp1-x);
					long sub=Math.min(tmp3, diff);
					tmp3-=sub;
					tmp1-=sub;
					if(tmp3>0) {
						tmp2-=Math.min(Math.max(0, tmp2-y), tmp3);
					}
				//}else {
					 diff=Math.max(0, b-y);
					 sub=Math.min(n, diff);
					n-=sub;
					b-=sub;
					if(n>0) {
						a-=Math.min(Math.max(0, a-x), n);
					}
				//}
				out.println(Math.min(a*b*1l, tmp1*1l*tmp2*1l));
				
						
			}
		}
	  static void C() throws IOException {
		  int t=ni();
		  while(t-->0) {
			  int n=ni(),x=ni(),y=ni();
			//  out.println(primes.get(1));
			  int div=0,diff=y-x;
			  for(int e=1;e<=50;e++) {
				  if(diff%e==0&&(diff/e)<=n-1) {
					  div=e;
					  break;
				  }
			  }
			  if(diff==0)div=diff;
			  
			  ArrayList<Integer>ans=new ArrayList<Integer>();
			  for(int i=x;i<=y;i+=div,n--) {
				  ans.add(i);
			  }
			  for(int i=x-div;i>0&&n>0;i-=div,n--) {
				  ans.add(i);
			  }
			  for(int i=y+div;n>0;i+=div,n--) {
				  ans.add(i);
			  }
			  for(int hh:ans) {
				  out.print(hh+" ");
			  }
			  out.println();
			  
			  
		  }
		  
		}



	static void D() throws IOException {
		int t=ni();
		while(t-->0) {
			String ss=sc.next();
			int s=ni();
			char[]cc=new char[ss.length()+1];
			cc[0]='0';
			for(int i=0;i<ss.length();i++) {
				cc[i+1]=ss.charAt(i);
			}
			int sum=sum(cc);
			
			long ans=0;
			if(sum>s) {
				//int n=ss.length();
				long ten=1;
				for(int i=cc.length-1;i>=1;i--) {
					long tmp=('9'-cc[i])+1;
					ans+=(tmp*ten*1l);
					int cur=i-1;
					if(cc[cur]=='9') {
					while(cur>=1&&cc[cur]=='9') {
						cc[cur--]='0';
					}
					cc[cur]+=1;
					}else {
						cc[cur]+=1;
					}
					cc[i]='0';
					ten*=10*1l;
					if(sum(cc)<=s)break;
				}
			}
			out.println(ans);
		}
		
	}
	private static int sum(char[] ss) {
		int sum=0;
		for(int i=0;i<ss.length;i++) {
			sum+=(ss[i]-'0');
		}
		return sum;
	}
	static int gcd (int a, int b) {
	    return b==0?a:gcd (b, a % b);
	}
	static int lcm (int a, int b) {
	    return a / gcd(a, b) * b;
	}
	static void E() throws IOException {
		int t=ni();
		while(t-->0) {
			int n=ni(),k=ni();
			int[]p=new int[n];
			for(int i=0;i<n;i++) {
				p[i]=ni();
			}
			for(int i=0;i<n;i++) {
				ni();
			}
			ruffleSort(p);
			int[]l=new int[n],r=new int[n];
			l[0]=1;
			for(int i=1,prev=0;i<n;i++) {
				while(p[i]-p[prev]>k) {
					prev++;
				}
				l[i]=i-prev+1;
			}
			r[n-1]=1;
			for(int i=n-2,prev=n-1;i>=0;i--) {
				while(p[prev]-p[i]>k) {
					prev--;
				}
				r[i]=prev-i+1;
			}
			for(int i=1;i<n;i++) {
				l[i]=Math.max(l[i], l[i-1]);
			}
			for(int i=n-2;i>=0;i--) {
				r[i]=Math.max(r[i], r[i+1]);
			}
			int ans=1;
			for(int i=0;i<n-1;i++) {
				ans=Math.max(ans, l[i]+r[i+1]);
			}
			
			out.println(ans);
			
		}
		
		
		
	}
	static final Random random=new Random();
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	static void F() throws IOException{
		int t=1;
		while(t-->0) {
			 n=ni();
			 k=ni();
			 s=sc.next();
			 tt=sc.next();
			dp=new int[n][k+1][n];
			for(int i=0;i<n;i++)for(int j=0;j<=k;j++)Arrays.fill(dp[i][j], oo);
			dp(0,0,0);
			int max=0;
			for(int i=0;i<n;i++) {
				for(int j=0;j<=k;j++) {
					for(int kk=0;kk<n;kk++) {
						max=Math.max(max, dp[i][j][kk]);
					}
				}
			}
			out.println(max);
		}
		
	}

	private static int dp(int i, int ck, int total) {
		if(i==n)return 0;
		if(dp[i][ck][total]>=0)return dp[i][ck][total];
		int e0=s.charAt(i)==tt.charAt(0)?1:0;
		int e1=s.charAt(i)==tt.charAt(1)?1:0;
		int e01=tt.charAt(0)==tt.charAt(1)?1:0;
		int ans=dp(i+1,ck,total+e0)+(e1==1?total:0);
		if(ck<k) {
			ans=Math.max(ans, dp(i+1,ck+1,total+1)+(e01==1?total:0));
			ans=Math.max(ans,dp(i+1,ck+1,total+e01)+total);
		}
		return dp[i][ck][total]=ans;
	}
	private static long solve(char[] cc, char xx, char yy) {
		long ans=0;
		for(int i=0;i<n-1;i++) {
			for(int j=i+1;j<n;j++) {
				if(cc[i]==xx&&cc[j]==yy)ans++;
			}
		}
		return ans;
	}
	static void G() throws IOException{
		int t=1;
		while(t-->0) {

			
			
			
		}
		
	}
	private static void disp(int[] revl) {
		for(int i=0;i<revl.length;i++) {
			out.print(revl[i]+" ");
		}
		out.println();
	}

	static int ni() throws IOException {
		return sc.nextInt();
	}
	static double nd() throws IOException {
		return sc.nextDouble();
	}
	static long nl() throws IOException {
		return  sc.nextLong();
	}
	static String ns() throws IOException {
		return sc.next();
	}
	static int[] nai(int n) throws IOException {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = sc.nextInt();
		return a;
	}
	static long[] nal(int n) throws IOException {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = sc.nextLong();
		return a;
	}
	static int[][] nmi(int n,int m) throws IOException{
		int[][]a=new int[n][m];
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=sc.nextInt();
			}
		}
		return a;
	}

	static long[][] nml(int n,int m) throws IOException{
		long[][]a=new long[n][m];
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=sc.nextLong();
			}
		}
		return a;
	}
	static void o(String x) {
		out.print(x);
	}
	static void ol(String x) {
		out.println(x);
	}
	static void ol(int x) {
		out.println(x);
	}
	static void disp1(int []a) {
		for(int i=0;i<a.length;i++) {
			out.print(a[i]+" ");
		}
		out.println();
	}

	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

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

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public boolean hasNext() {return st.hasMoreTokens();}
		public int nextInt() throws IOException {return Integer.parseInt(next());}
		
		public double nextDouble() throws IOException {return Double.parseDouble(next());}
		
		public long nextLong() throws IOException {return Long.parseLong(next());}

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

	}
}
