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

public class Coding {

    private static BufferedReader bi = new BufferedReader(new InputStreamReader(System.in));
    private static BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) {
        try {
            run();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void run() throws Exception {
        InputModule inp = new InputModule();
        OutputModule out = new OutputModule();
        int t = 1;
        while (t > 0) {
            int[] ints = inp.cinIntArray(2);
            int n = ints[0];
            int rep = ints[1];
            String s1 = inp.cinString();
            String s2 = inp.cinString();
            if (s2.charAt(0)==s2.charAt(1)) {
                int count = 0;
                for(int i=0;i<s1.length();++i) if (s1.charAt(i) == s2.charAt(0)) count++;
                count+=rep;
                count = Math.min(count, n);
                out.printInt((count*(count-1))/2);
                t--;
                continue;
            }
            int[][][] dp = new int[n][n+1][rep+1];
            for(int i=0;i<n;++i) {
                for(int j=0;j<=n;++j) {
                    for(int k=0;k<=rep;++k) {
                        dp[i][j][k] = -1;
                    }
                }
            }
            for(int i=0;i<n;++i) {
                if (i == 0) {
                    if (s1.charAt(0) == s2.charAt(0)) {
                        dp[0][1][0] = 0;
                    } else {
                        dp[0][0][0] = 0;
                        if (rep>0) dp[0][1][1] = 0;
                    }
                } else {
                    for(int j=0;j<=i+1;++j) {
                        for(int k=0;k<=Math.min(i+1,rep);++k) {
                            if (s1.charAt(i) == s2.charAt(0)) {
                                if (j>0) {
                                    dp[i][j][k] = Math.max(dp[i][j][k], dp[i-1][j-1][k]);
                                }
                                if (k>0 && (dp[i-1][j][k-1]!=-1)) {
                                    dp[i][j][k] = Math.max(dp[i][j][k], dp[i-1][j][k-1] + j);
                                }
                            } else if (s1.charAt(i) == s2.charAt(1)){
                                if (dp[i-1][j][k]!=-1) {
                                    dp[i][j][k] = Math.max(dp[i][j][k], dp[i-1][j][k] + j);
                                }

                                if (j>0 && k>0) {
                                    dp[i][j][k] = Math.max(dp[i][j][k], dp[i-1][j-1][k-1]);
                                }
                            } else {
                                dp[i][j][k] = dp[i-1][j][k];
                                if (j>0 && k>0) {
                                    dp[i][j][k] = Math.max(dp[i][j][k], dp[i-1][j-1][k-1]);
                                }
                                if (k>0 && (dp[i-1][j][k-1]!=-1)) {
                                    dp[i][j][k] = Math.max(dp[i][j][k], dp[i-1][j][k-1] + j);
                                }
                            }
                        }
                    }
                }
            }
            int ans = 0;
            for(int j=1;j<=n;++j)
                for(int k=0;k<=rep;++k) {
                    ans = Math.max(ans, dp[n - 1][j][k]);
                }

            out.printInt(ans);
            t--;
        }
    }


    private static class InputModule {
        private int cinInt() throws Exception {
            return Integer.parseInt(bi.readLine().split(" ")[0].trim());
        }

        private long cinLong() throws Exception {
            return Long.parseLong(bi.readLine().split(" ")[0].trim());
        }

        private Double cinDouble() throws Exception {
            return Double.parseDouble(bi.readLine().split(" ")[0].trim());
        }

        private String cinString() throws Exception {
            return bi.readLine();
        }

        private int[] cinIntArray(int n) throws Exception {
            String input = bi.readLine();
            String[] values = input.split(" ");
            int[] ar = new int[n];
            for (int i = 0; i < n; ++i) {
                ar[i] = Integer.parseInt(values[i]);
            }
            return ar;
        }

        private int[] cinIntArray() throws Exception {
            String input = bi.readLine();
            String[] values = input.split(" ");
            int[] ar = new int[values.length];
            for (int i = 0; i < values.length; ++i) {
                ar[i] = Integer.parseInt(values[i]);
            }
            return ar;
        }

        private long[] cinLongArray(int n) throws Exception {
            String input = bi.readLine();
            String[] values = input.split(" ");
            long[] ar = new long[n];
            for (int i = 0; i < n; ++i) {
                ar[i] = Long.parseLong(values[i]);
            }
            return ar;
        }

        private String[] cinStringArray(int n) throws Exception {
            return bi.readLine().split(" ");
        }
    }

    private static class OutputModule {
        private void printInt(int ans) throws Exception {
            writer.append(ans + "\n");
            writer.flush();
        }

        private void printLong(long ans) throws Exception {
            writer.append(ans + "\n");
            writer.flush();
        }

        private void printDouble(Double ans) throws Exception {
            writer.append(String.format("%.10f", ans));
            writer.append("\n");
            writer.flush();
        }

        private void printString(String ans) throws Exception {
            writer.append(ans + "\n");
            writer.flush();
        }

        private void printIntArray(int[] ans) throws Exception {
            for (int i = 0; i < ans.length; ++i) {
                writer.append(ans[i] + " ");
            }
            writer.append("\n");
            writer.flush();
        }

        private void printLongArray(long[] ans) throws Exception {
            for (int i = 0; i < ans.length; ++i) {
                writer.append(ans[i] + " ");
            }
            writer.append("\n");
            writer.flush();
        }

        private void printIntMatrix(int[][] mat, int n, int m) throws Exception {
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < m; ++j) {
                    writer.append(mat[i][j] + " ");
                }
                writer.append("\n");
            }
            writer.flush();
        }

        private void printLongMatrix(long[][] mat, int n, int m) throws Exception {
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < m; ++j) {
                    writer.append(mat[i][j] + " ");
                }
                writer.append("\n");
            }
            writer.flush();
        }

        private void printPoint(Point p) throws Exception {
            writer.append(p.x + " " + p.y + "\n");
            writer.flush();
        }

        private void printPoints(List<Point> p) throws Exception {
            for (Point pp : p) {
                writer.append(pp.x + " " + pp.y + "\n");
            }
            writer.flush();
        }
    }
}