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.
// package com.company;
import java.util.*;
import java.lang.*;
import java.io.*;
//****Use Integer Wrapper Class for Arrays.sort()****
public class FB6 {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
        int t=1;
//        t=scan.nextInt();
        while(t-->0){
            int n=scan.nextInt();
            int k=scan.nextInt();
            String s=scan.next();
            String ss=scan.next();
            int[][][] dp=new int[n][n+1][k+1];
            for(int i=0;i<n;i++){
                for(int j=0;j<=n;j++){
                    Arrays.fill(dp[i][j],-1);
                }
            }
            out.println(recur(0,s,ss.charAt(0),ss.charAt(1),dp,0,k));
        }
        out.flush();
        out.close();
    }
    static int recur(int i,String s,char a,char b,int[][][] dp,int ac,int k){
        if(i==s.length()){
            return 0;
        }
        if(dp[i][ac][k]!=-1){
            return dp[i][ac][k];
        }
        dp[i][ac][k]=0;
        char ch=s.charAt(i);
        int set=0;
        if(ch!=a&&ch!=b){
            set=recur(i+1,s,a,b,dp,ac,k);
        }
        if(ch==a){
            int add=0;
            if(ch==b) {
                add = ac;
            }
            set=Math.max(set,add+recur(i+1,s,a,b,dp,ac+1,k));
        }
        if(ch==b){
            int add=0;
            if(ch==a){
                add++;
            }
            set=Math.max(set,ac+recur(i+1,s,a,b,dp,ac+add,k));
        }
        if(ch!=a&&k>0){
            int add=0;
            if(a==b){
                add=ac;
            }
            set=Math.max(set,add+recur(i+1,s,a,b,dp,ac+1,k-1));
        }
        if(ch!=b&&k>0){
            int add=0;
            if(a==b){
                add++;
            }
            set=Math.max(set,ac+recur(i+1,s,a,b,dp,ac+add,k-1));
        }
        dp[i][ac][k]=set;
        return set;
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
}
