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>
long long q_pow(long long x, long long n, long long mod) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = x * ret % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ret;
}
long long __gcd(long long x, long long y) {
  if (!y) return x;
  return __gcd(y, x % y);
}
long long getbit(long long now) {
  int cnt = 0;
  while (now) {
    cnt++;
    now -= (now) & (-now);
  }
  return cnt;
}
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
using namespace std;
const long long INF = 0x3f3f3f3f;
const long long IINF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 200 + 9;
const int maxm = 1e3 + 5;
const double eps = 1e-7;
const double pi = acos(-1);
const long long mod = 1e9 + 7;
char s[maxn];
char t[4];
int dp[maxn][maxn][maxn];
signed main(int argc, char *argv[]) {
  if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  }
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (int i = 0; i < maxn; i++)
    for (int j = 0; j < maxn; j++)
      for (int k = 0; k < maxn; k++) dp[i][j][k] = -INF;
  dp[0][0][0] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= n; j++)
      for (int u = 0; u <= k; u++) {
        if (s[i] != t[1] and s[i] != t[2]) {
          dp[i][j][u] = dp[i - 1][j][u];
          if (u and j) dp[i][j][u] = max(dp[i][j][u], dp[i - 1][j - 1][u - 1]);
          if (u) dp[i][j][u] = max(dp[i][j][u], dp[i - 1][j][u - 1] + j);
        }
        if (s[i] == t[1]) {
          dp[i][j][u] = dp[i - 1][j - 1][u];
          if (u) dp[i][j][u] = max(dp[i][j][u], dp[i - 1][j][u - 1] + j);
        }
        if (s[i] == t[2]) {
          if (u and j) dp[i][j][u] = dp[i - 1][j - 1][u - 1];
          dp[i][j][u] = max(dp[i - 1][j][u] + j, dp[i][j][u]);
        }
      }
  long long ans = 0;
  int cnt = -INF;
  if (t[1] == t[2]) {
    cnt = 0;
    for (int i = 1; i <= n; i++) {
      if (s[i] == t[1]) cnt++;
    }
  }
  if (cnt != -INF)
    ans = min(cnt + k, n) * (min(cnt + k, n) - 1) / 2;
  else {
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= k; j++) ans = max(ans, dp[n][i][j] * 1LL);
    cerr << ans << endl;
  }
  cout << ans << endl;
  return 0;
}