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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Solution{
	
	static final int N = 205;
	static final int inf = (int)1e9;
	
    public static void main(String[] args) throws IOException {
    	
		
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    		
    	int tt = 1;
    	while(tt-->0) {

    		int n = fs.nextInt(), k = fs.nextInt();
    		char[] s = fs.next().toCharArray();
    		char[] t = fs.next().toCharArray();
    		
    		if(t[0]==t[1]) {
    			char ch = t[0];
    			int sum = 0;
    			for(int i=0;i<n;i++) if(s[i]==ch) sum++;
    			int num = Math.min(n, sum + k);
    			out.println(num*(num-1)/2);
    			out.flush();
    			return;
    		}
    		
    		int[][][] dp = new int[n+1][n+1][k+2];
    		for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) for(int m=0;m<k+2;m++) dp[i][j][m] = -inf;
    		dp[0][0][0] = 0;
    		
    		
    		for(int ind=0;ind<n;ind++) {
    			for(int numa=0;numa<n;numa++) {
    				for(int moves=0;moves<=k;moves++) {
    					if(dp[ind][numa][moves]==-inf) continue;
    					char ch = s[ind];
    					if(ch==t[0]) {
    						dp[ind+1][numa+1][moves] = Math.max(dp[ind+1][numa+1][moves], dp[ind][numa][moves]);
    						dp[ind+1][numa][moves+1] = Math.max(dp[ind+1][numa][moves+1], dp[ind][numa][moves] + numa);
    					}
    					else if(ch==t[1]) {
    						dp[ind+1][numa][moves] = Math.max(dp[ind+1][numa][moves], dp[ind][numa][moves] + numa);
    						dp[ind+1][numa+1][moves+1] = Math.max(dp[ind+1][numa+1][moves+1], dp[ind][numa][moves]);
    					}
    					else {
    						dp[ind+1][numa][moves] = Math.max(dp[ind+1][numa][moves], dp[ind][numa][moves]);
    						dp[ind+1][numa+1][moves+1] = Math.max(dp[ind+1][numa+1][moves+1], dp[ind][numa][moves]);
    						dp[ind+1][numa][moves+1] = Math.max(dp[ind+1][numa][moves], dp[ind][numa][moves] + numa);
    					}
    				}
    			}
    		}
    		
    		
    		int ans = 0;
    		
    		for(int i=1;i<=n;i++) for(int j=0;j<=n;j++) for(int m=0;m<=k;m++) ans = Math.max(ans, dp[i][j][m]);
    		
    		out.println(ans);
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    	}
    	
    	out.close();
    	
    }
    
    
    
   
    
    
    static final Random random=new Random();
    
    static <T> void shuffle(T[] arr) {
    	int n = arr.length;
    	for(int i=0;i<n;i++	) {
    		int k = random.nextInt(n);
    		T temp = arr[k]; arr[k] = arr[i]; arr[i] = temp;
    	}
    }
    
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
    
    static void ruffleSort(long[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); long temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    static void reverse(int[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		int temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    static void reverse(long[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		long temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    
    static <T> void reverse(T[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++) {
    		T temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}