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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;

public class PatternsInString {

    public static void main(String[] args) throws IOException {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String[] ab = br.readLine().split(" ");
            int n = Integer.parseInt(ab[0]);
            int k = Integer.parseInt(ab[1]);
            String s = br.readLine();
            String t = br.readLine();
            System.out.println(solve(n,k,s,t));
        }
    }

    private static int solve(int n, int k, String s, String t) {
        return new PatternsInString().new DynamicProgram(n,k,s,t).solve(0,k, 0);
    }

    private class State {
        int i;
        int k;
        int numA;

        State(int i2, int k2, int as) {
            i = i2;
            k = k2;
            numA=as;
        }

        @Override
        public int hashCode() {
            return Arrays.hashCode(new int[] {i, k, numA});
        }

        @Override
        public boolean equals(Object obj) {
            State o = (State) obj;
            return o.i == i && o.k == k && o.numA == numA;
        }
    }

    private class DynamicProgram {
        int[][][] memo;
        String s,t;

        DynamicProgram(int n, int k, String s, String t) {
            memo = new int[n][k+1][n];
            this.s = s; this.t = t;
        }

        public int solve(int i, int k, int numA) {
            if (i >= s.length()) return 0;
            if (memo[i][k][numA] > 0)
                return memo[i][k][numA] - 1;
            int max = Integer.MIN_VALUE;
            if (k > 0) {
                // 0. Edge case
                if (t.charAt(0) == t.charAt(1)) {
                    max = Integer.max(max, solve(i + 1, k - 1, numA + 1) + numA);
                } else {
                    //1. Set A
                    if (s.charAt(i) != t.charAt(0)) {
                        max = Integer.max(max, solve(i + 1, k - 1, numA + 1));
                    }
                    // 2. Set B
                    if (s.charAt(i) != t.charAt(1)) {
                        max = Integer.max(max, solve(i + 1, k - 1, numA) + numA);
                    }
                }
            }
            // 3. Do nothing
            if (s.charAt(i) == t.charAt(0) && t.charAt(0) == t.charAt(1)) {
                max = Integer.max(max, solve(i + 1, k, numA + 1) + numA);
            } else if (s.charAt(i) == t.charAt(0)) {
                max = Integer.max(max, solve(i + 1, k, numA + 1));
            } else if (s.charAt(i) == t.charAt(1)) {
                max = Integer.max(max, solve(i + 1, k, numA) + numA);
            } else {
                max = Integer.max(max, solve(i + 1, k, numA));
            }
            memo[i][k][numA] = max + 1;
            return max;
        }

    }
}