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 com.sun.org.apache.xpath.internal.SourceTree;
import com.sun.org.apache.xpath.internal.functions.FuncFalse;
import javafx.util.Pair;

import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Contest {
    public static class pair implements Comparable<pair> {
        long l;
        long r;


        public pair(long lef, long ri) {
            l = lef;
            r = ri;
        }

        @Override
        public int compareTo(pair p) {
            if (l == p.l)
                return Long.compare(r, p.r);
            return Long.compare(l, p.l);
        }
    }

    static int n, m;
    static ArrayList<Integer>[] adj;
    static int dist[];
    static int[] h;
    static int[] p;
    static int parent[];
    static long inf = (long) 1e18;
    static int INF = (int) 1e9;


    public static boolean isSimilar(char[] Arr, int s, int k) {
        for (int i = s; i < k - 1; i++) {
            if (Arr[i + 1] != Arr[i])
                return false;
        }
        return true;
    }

    public static int ciel(int d, int mod) {
        if (d % mod == 0)
            return d / mod;
        return (d / mod) + 1;
    }


    public static long gcd(long u, long v) {
        if (v == 0)
            return u;
        return gcd(v, u % v);
    }

    static int k, Arr[], lefAcc[], riAcc[];
    static PrintWriter pw;

    static long memo[][];
    static char[][] Matrix;
    static int[] dx = new int[]{-1, 1, 0, 0};

    static int[] dy = new int[]{0, 0, -1, 1};


    static boolean valid(int i, int j) {

        return i != -1 && j != -1 && i != n && j != m;

    }


//    static boolean[][] vis = new boolean[n][m];
//
//    static void dfs2(int i, int j) {
//
//        vis[i][j] = true;                    //mark as visited
//
//        for (int k = 0; k < 4; ++k) {
//
//            int x = i + dx[k], y = j + dy[k];
//
//            if (valid(x, y) && Matrix[x][y] != '#' && !vis[x][y])
//
//                dfs2(x, y);
//
//        }
//
//    }

    public static int getnum(int[][] matrix, int i, int j) {
        int c = 0;

        for (int k = 0; k < 4; ++k) {

            int x = i + dx[k], y = j + dy[k];

            if (valid(x, y))
                c++;

        }
        return c;
    }

    static String str;

    public static int howManyChar(char c, int lo, int hi) {
        int cnt = 0;
        for (int i = lo; i <= hi; i++) {
            if (str.charAt(i) == c) cnt++;
        }
        return (hi - lo + 1) - cnt;
    }

    public static long divCon(int lo, int hi, char c) {
        if (lo == hi)
            return c == str.charAt(lo) ? 0 : 1;
        int mid = (lo + hi) >> 1;
        char next = (char) (c + 1);
        return min(howManyChar(c, lo, mid) + divCon(mid + 1, hi, next),
                howManyChar(c, mid + 1, hi) + divCon(lo, mid, next));
    }

    static Stack<Integer> topo;

    public static int dfs(int u) {
        vis[u] = true;
        int ans = 0;
        for (int v : adj[u]) {
            if (!vis[v])
                ans += dfs(v);
        }
        return dist[u] = ans + p[u];
    }

    static boolean ans;

    public static int dfs2(int u) {
        vis[u] = true;
        ans &= abs(h[u]) <= dist[u] && ((dist[u] + h[u]) % 2 == 0);
        int pos = ((dist[u] + h[u]) / 2);
        int neg = dist[u] - pos;
        int dif = neg - p[u];
        if (dif > 0) dif = 0;
        int res = 0;
        for (int v : adj[u])
            if (!vis[v])
                res += dfs2(v);

        ans &= pos + dif >= res;
        return pos;
    }

    static boolean vis[];
    static long memoo[][][];
    public static long dp(int idx, int num, int rem) {
        if (idx == n) return 0;
        long ans = 0;
        if(memoo[idx][num][rem]!=-1)
            return memoo[idx][num][rem];
        if (s.charAt(idx) == fir)
            ans = max(ans, dp(idx + 1, num + 1, rem));
        if (s.charAt(idx) == sec && num != 0)
            ans = max(ans, num + dp(idx + 1, num+(fir==sec?1:0), rem));
        if (rem > 0) {
            ans = max(ans, dp(idx + 1, num + 1, rem - 1));
            if (num != 0)
                ans = max(ans, num + dp(idx + 1, num+(fir==sec?1:0), rem - 1));
        }
        ans = max(ans, dp(idx + 1, num, rem));
        return memoo[idx][num][rem]=ans;
    }

    static String s, t;
    static char fir, sec;

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        n = sc.nextInt();
        k = sc.nextInt();
        s = sc.next();
        t = sc.next();
        fir = t.charAt(0);
        sec = t.charAt(1);
        memoo=new long[n][n][k+1];
        for(long[][]x:memoo)
            for (long[]y:x)
                Arrays.fill(y,-1);

        pw.println(dp(0, 0, k));
        pw.close();

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException, IOException {
            return br.ready();
        }

    }
}