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

public class Main {
    public static void main(String args[]) {new Main().run();}

    FastReader in = new FastReader();
    PrintWriter out = new PrintWriter(System.out);
    void run(){
        work();
        out.flush();
    }
    long mod=1000000007;
    long gcd(long a,long b) {
        return a==0?b:gcd(b%a,a);
    }

    void work() {
        int n=ni(),k=ni();
        String s=ns(),t=ns();
        char c1=t.charAt(0),c2=t.charAt(1);
        if(c1==c2){
            out.println(count(s,c1,k));
            return;
        }

        int[][][] dp=new int[n+1][202][202];
        for(int[][] d1:dp){
            for(int[] d:d1){
                Arrays.fill(d,-99999999);
            }
        }
        dp[0][0][0]=0;
        for(int i=0;i<n;i++){
            //改为c1
            for(int j=0;j<=200;j++){
                for(int p=0;p<=200;p++){
                    if(dp[i][j][p]>=0){
                        dp[i+1][j+1][p+1]=Math.max(dp[i+1][j+1][p+1],dp[i][j][p]);
                    }
                }
            }
            //改为c2
            for(int j=0;j<=200;j++){
                for(int p=0;p<=200;p++){
                    if(dp[i][j][p]>=0){
                        dp[i+1][j][p+1]=Math.max(dp[i+1][j][p+1],dp[i][j][p]+j);
                    }
                }
            }
            //不改
            for(int j=0;j<=200;j++){
                for(int p=0;p<=200;p++){
                    if(dp[i][j][p]>=0){
                        if(c1==s.charAt(i)){
                            dp[i+1][j+1][p]=Math.max(dp[i][j][p],dp[i+1][j+1][p]);
                        }else if(c2==s.charAt(i)){
                            dp[i+1][j][p]=Math.max(dp[i][j][p]+j,dp[i+1][j][p]);
                        }else{
                            dp[i+1][j][p]=Math.max(dp[i+1][j][p],dp[i][j][p]);
                        }
                    }
                }
            }
        }

        int ret=0;
        for(int i=0;i<=200;i++){
            for(int j=0;j<=k;j++){
                ret=Math.max(ret,dp[n][i][j]);
            }
        }
        out.println(ret);
    }

    private int count(String s, char c,int k) {
        int cnt=0;
        for(char ch:s.toCharArray()){
            if(ch==c){
                cnt++;
            }
        }
        int v=Math.min(cnt+k,s.length());
        return v*(v-1)/2;
    }

    //input
    @SuppressWarnings("unused")
    private ArrayList<Integer>[] ng(int n, int m) {
        ArrayList<Integer>[] graph=(ArrayList<Integer>[])new ArrayList[n];
        for(int i=0;i<n;i++) {
            graph[i]=new ArrayList<>();
        }
        for(int i=1;i<=m;i++) {
            int s=in.nextInt()-1,e=in.nextInt()-1;
            graph[s].add(e);
            graph[e].add(s);
        }
        return graph;
    }

    private ArrayList<long[]>[] ngw(int n, int m) {
        ArrayList<long[]>[] graph=(ArrayList<long[]>[])new ArrayList[n];
        for(int i=0;i<n;i++) {
            graph[i]=new ArrayList<>();
        }
        for(int i=1;i<=m;i++) {
            long s=in.nextLong()-1,e=in.nextLong()-1,w=in.nextLong();
            graph[(int)s].add(new long[] {e,w,i});
            graph[(int)e].add(new long[] {s,w});
        }
        return graph;
    }

    private int ni() {
        return in.nextInt();
    }

    private long nl() {
        return in.nextLong();
    }

    private String ns() {
        return in.next();
    }

    private long[] na(int n) {
        long[] A=new long[n];
        for(int i=0;i<n;i++) {
            A[i]=in.nextLong();
        }
        return A;
    }
    private int[] nia(int n) {
        int[] A=new int[n];
        for(int i=0;i<n;i++) {
            A[i]=in.nextInt();
        }
        return A;
    }
}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }


    public String next()
    {
        while(st==null || !st.hasMoreElements())//回车，空行情况
        {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

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

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