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 _1409F {
    static int[] MODS = {1000000007, 998244353};
    static int MOD = MODS[0];
    static int[][][] dp;
    static int[] arr;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        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 c = t.charAt(0);
            int count = 0;
            for (int i = 0; i < n; i++) {
                if (s.charAt(i) == c) {
                    count++;
                }
            }
            count = Math.min(n, count + k);
            out.println(count * (count - 1) / 2);
            out.close();
            return;
        }
        arr = new int[n];
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == t.charAt(0)) {
                arr[i] = 0;
            } else if (s.charAt(i) == t.charAt(1)) {
                arr[i] = 1;
            } else {
                arr[i] = -1;
            }
        }
        dp = new int[n+1][n+1][k+1]; // position, number of char, number of switch
        for (int i = 0; i < dp.length; i++) {
            for (int j = 0; j < dp[i].length; j++) {
                Arrays.fill(dp[i][j], -1000000);
            }
        }
        Arrays.fill(dp[0][0], -2000000000);
        dp[0][0][0] = 0;
        for (int i = 0; i < dp.length; i++) {
            for (int j = 0; j < dp[i].length; j++) {
                if (j > i) {
                    Arrays.fill(dp[i][j], -2000000000);
                }
            }
        }
        int max = 0;
        for (int i = 0; i < dp[0].length; i++) {
            for (int j = 0; j <= k; j++) {
                max = Math.max(max, dpmypp(n, i, j));
            }
        }
        out.println(max);
        out.close();
    }

    public static int dpmypp(int a, int b, int c) {
        if (b < 0) {
            return -2000000000;
        }
        if (dp[a][b][c] != -1000000) {
            return dp[a][b][c];
        }
        if (c == 0) {
            if (arr[a-1] == 0) {
                if (b == 0) {
                    return dp[a][b][c] = Integer.MIN_VALUE;
                }
                dp[a][b][c] = dpmypp(a-1, b-1, c);
            } else if (arr[a-1] == 1) {
                dp[a][b][c] = dpmypp(a-1, b, c) + b;
            } else {
                dp[a][b][c] = dpmypp(a-1, b, c);
            }
            return dp[a][b][c];
        }
        dp[a][b][c] = Integer.MIN_VALUE;
        if (arr[a-1] == 0) {
            if (b > 0) {
                dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a - 1, b - 1, c));
            }
            dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a-1, b, c-1) + b);
        } else if (arr[a-1] == 1) {
            dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a-1, b, c) + b);
            if (b > 0) {
                dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a - 1, b-1, c - 1));
            }
        } else {
            dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a-1, b, c));
            if (b > 0) {
                dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a - 1, b-1, c - 1));
            }
            dp[a][b][c] = Math.max(dp[a][b][c], dpmypp(a-1, b, c-1) + b);
        }
        return dp[a][b][c];
    }

    public static int[] sort(int[] arr) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < arr.length; i++) {
            list.add(arr[i]);
        }
        Collections.sort(list);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = list.get(i);
        }
        return arr;
    }

    public static PrintWriter out;

    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;
        }
    }
}