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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const double EPS = 1e-9;
const int MAXN = 222;
string s, t;
int n, k;
vector<int> non, a, b;
int curS[MAXN], origS[MAXN];
int curAns, origAns;
int bit0[MAXN], bit1[MAXN];
void updateBIT(int* BIT, int n, int i, int val) {
  for (i++; i <= n; i += i & -i) {
    BIT[i] += val;
  }
}
int queryBIT(int* BIT, int n, int i) {
  int ret = 0;
  for (i++; i > 0; i -= i & -i) {
    ret += BIT[i];
  }
  return ret;
}
int queryBIT(int* BIT, int n, int i, int j) {
  return queryBIT(BIT, n, j) - (i == 0 ? 0 : queryBIT(BIT, n, i - 1));
}
void updateS(int i, int x) {
  int delta0 = i + 1 < n ? queryBIT(bit1, n, i + 1, n - 1) : 0;
  int delta1 = i > 0 ? queryBIT(bit0, n, 0, i - 1) : 0;
  if (curS[i] == 0) {
    curAns -= delta0;
    updateBIT(bit0, n, i, -1);
  } else if (curS[i] == 1) {
    curAns -= delta1;
    updateBIT(bit1, n, i, -1);
  }
  if (x == 0) {
    curAns += delta0;
    updateBIT(bit0, n, i, 1);
  } else if (x == 1) {
    curAns += delta1;
    updateBIT(bit1, n, i, 1);
  }
  curS[i] = x;
}
void restoreS() {
  curAns = origAns;
  fill(bit0, bit0 + n + 1, 0);
  fill(bit1, bit1 + n + 1, 0);
  for (int i = 0; i < n; i++) {
    curS[i] = origS[i];
    if (curS[i] == 0) {
      updateBIT(bit0, n, i, 1);
    } else if (curS[i] == 1) {
      updateBIT(bit1, n, i, 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> s >> t;
  if (t[0] == t[1]) {
    int ct = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == t[0]) ct++;
    }
    int new_ct = min(ct + k, n);
    cout << new_ct * (new_ct - 1) / 2 << '\n';
    return 0;
  }
  int cur0 = 0;
  int diff_perfect = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == t[0]) {
      a.push_back(i);
      origS[i] = 0;
      cur0++;
    } else if (s[i] == t[1]) {
      b.push_back(i);
      origS[i] = 1;
      origAns += cur0;
    } else {
      non.push_back(i);
      origS[i] = 2;
    }
    if (i < n / 2) {
      if (origS[i] != 0) diff_perfect++;
    }
    if (i >= (n + 1) / 2) {
      if (origS[i] != 1) diff_perfect++;
    }
  }
  k = min(k, diff_perfect);
  int ans = 0;
  for (int pre_b = 0; pre_b <= k; pre_b++) {
    if (pre_b > int((b).size())) break;
    for (int suf_a = 0; pre_b + suf_a <= k; suf_a++) {
      if (suf_a > int((a).size())) break;
      int remain = k - (pre_b + suf_a);
      if (remain > int((non).size())) continue;
      restoreS();
      for (int i = 0; i < pre_b; i++) {
        updateS(b[i], 0);
      }
      for (int i = 0; i < suf_a; i++) {
        updateS(a[int((a).size()) - 1 - i], 1);
      }
      for (int i = 0; i < remain; i++) {
        updateS(non[int((non).size()) - 1 - i], 1);
      }
      for (int pre_non = 0; pre_non <= remain; pre_non++) {
        int suf_non = remain - pre_non;
        ans = max(curAns, ans);
        if (pre_non != remain) {
          if (pre_non == int((non).size()) - suf_non) {
            updateS(non[pre_non], 0);
          } else {
            updateS(non[pre_non], 0);
            updateS(non[int((non).size()) - suf_non], 2);
          }
        }
      }
    }
  }
  cout << ans << '\n';
  return 0;
}