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 F667 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt(); int k = sc.nextInt();
        String s = sc.next(); String t = sc.next();
        if (t.charAt(0) == t.charAt(1)) {
            char check = t.charAt(0);
            int ct = 0;
            for (int i = 0; i < n; i++) if (s.charAt(i) == check) ct++;
            out.println(nC2(Math.min(ct + k, n)));
            out.close();
            return;
        }
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == t.charAt(0)) a[i] = 0;
            else if (s.charAt(i) == t.charAt(1)) a[i] = 1;
            else a[i] = 2;
        }
        int [] suf = new int[n];
        suf[n - 1] = (a[n - 1] == 1 ? 1 : 0);
        for (int i = n - 2; i >= 0; i--) {
            suf[i] = suf[i + 1] + (a[i] == 1 ? 1 : 0);
        }
        int [][][][] dp = new int[n][n + 1][k + 1][3];
        int res = 0;
        for (int i = n - 1; i >= 0; i--) {
            for (int j = 0; j <= n - i; j++) {
                for (int m = 0; m <= Math.min(k, n - i); m++) {
                    for (int c = 0; c < 3; c++) {
                        if (i == n - 1) {
                            if (m == 0 && j > 0 && a[i] != 1) dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            if (m == 0 && j == 0 && a[i] == 1) dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            if (m == 1 && a[i] == c) dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            if (m == 0 && a[i] != c) dp[i][j][m][c]= Integer.MIN_VALUE / 2;

                            continue;
                        }
                        if (i == 2 && j == 4 && m == 2 && c == 1) {
                            //System.out.println();
                        }
                        if (c != 1 && j == n - i) {
                            dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            continue;
                        }
                        if (m == 0 && a[i] != c) {
                            dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            continue;
                        }
                        if (j == 0 && c == 1) {
                            dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            continue;
                        }
                        int init = suf[i];
                        int lowerBound = Math.abs(j - init);
                        if (m < lowerBound) {
                            dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                            continue;
                        }
                        int dif = (a[i] == c ? 0 : 1);
                        if (m == 1 && dif == 1) {
                            if (c == 1 && j != suf[i + 1] + 1) {
                                dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                                continue;
                            }
                            if (c != 1 && j != suf[i + 1]) {
                                dp[i][j][m][c] = Integer.MIN_VALUE / 2;
                                continue;
                            }
                        }
                        if (c == 0) {
                            for (int next = 0; next < 3; next++)
                                dp[i][j][m][c] = Math.max(dp[i][j][m][c], dp[i + 1][j][m - dif][next] + j);
                        } else if (c == 1) {
                            for (int next = 0; next < 3; next++)
                                dp[i][j][m][c] = Math.max(dp[i][j][m][c], dp[i + 1][j - 1][m - dif][next]);
                        } else {
                            for (int next = 0; next < 3; next++)
                                dp[i][j][m][c] = Math.max(dp[i][j][m][c], dp[i + 1][j][m - dif][next]);
                        }
                        res = Math.max(res, dp[i][j][m][c]);
                    }
                }
            }
        }
        //for (int i = n - 2; i >= 0; i--)
            //for (int j = 0; j <= n - i; j++)
               // for (int m = 0; m <= Math.min(k, n - i); m++)
                    //for (int c = 0; c < 3; c++)
                        //System.out.println(i + " " + j + " " + m + " " + c + " " + dp[i][j][m][c]);
        out.println(res);
        out.close();
    }

    static int nC2(int x) {
        return (x * (x - 1)) / 2;
    }


    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}