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;
class A {
 public:
  void solve() {
    int t;
    cin >> t;
    while (t--) {
      int a, b;
      cin >> a >> b;
      cout << (abs(b - a) + 9) / 10 << endl;
    }
  }
};
class B {
 public:
  void solve() {
    int t;
    cin >> t;
    while (t--) {
      long long a, b, x, y, n;
      cin >> a >> b >> x >> y >> n;
      long long amin = max(x, a - n);
      long long bmin = max(y, b - n);
      if (bmin <= amin) {
        swap(a, b);
        swap(x, y);
        swap(amin, bmin);
      }
      n -= a - amin;
      a = amin;
      b = max(y, b - n);
      cout << a * b << endl;
    }
  }
};
class C {
 public:
  void solve() {
    int t;
    cin >> t;
    while (t--) {
      long long n, x, y;
      cin >> n >> x >> y;
      long long res = LONG_LONG_MAX;
      long long dd = 0;
      for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
          if ((y - x) % (j - i) != 0) continue;
          long long d = (y - x) / (j - i);
          if (x - d * (i - 1) <= 0) continue;
          long long cur = y + (n - j) * d;
          if (cur < res) {
            res = cur;
            dd = d;
          }
        }
      }
      for (int i = 0; i < n; i++) {
        cout << res - (n - i - 1) * dd << " ";
      }
      cout << endl;
    }
  }
};
class D {
 public:
  void solve() {
    int t;
    cin >> t;
    auto check = [](long long s, long long x) {
      long long res = 0;
      while (x > 0) {
        res += (x % 10);
        x /= 10;
      }
      return res <= s;
    };
    while (t--) {
      long long n, s;
      cin >> n >> s;
      long long i = 1;
      long long bk = n;
      while (!check(s, n)) {
        n += (10 - ((n / i) % 10ll)) * i;
        i *= 10;
      }
      cout << n - bk << endl;
    }
  }
};
class E {
 public:
  void solve() {
    int t;
    cin >> t;
    while (t--) {
      long long n, k;
      cin >> n >> k;
      vector<pair<long long, long long>> a(n);
      for (int i = 0; i < n; i++) cin >> a[i].first;
      for (int i = 0; i < n; i++) cin >> a[i].second;
      sort(a.begin(), a.end());
      vector<long long> l(n, 0), r(n, 0);
      int st = 0;
      for (int i = 0; i < n; i++) {
        while (a[i].first - a[st].first > k) st++;
        l[i] = i - st + 1;
        if (i > 0) l[i] = max(l[i], l[i - 1]);
      }
      st = n - 1;
      for (int i = n - 1; i >= 0; i--) {
        while (a[st].first - a[i].first > k) st--;
        r[i] = st - i + 1;
        if (i < n - 1) r[i] = max(r[i], r[i + 1]);
      }
      long long res = 0;
      for (int i = 0; i < n; i++) {
        res = max(res, l[i]);
        if (i < n - 1) res = max(res, l[i] + r[i + 1]);
      }
      cout << res << endl;
    }
  }
};
class F {
 public:
  int inf = 0x3f3f3f3f;
  void solve() {
    int n, K;
    cin >> n >> K;
    string s, t;
    cin >> s >> t;
    vector<vector<vector<int>>> dp(
        n + 1, vector<vector<int>>(K + 1, vector<int>(n + 1, -inf)));
    dp[0][0][0] = 0;
    for (int i = 1; i <= n; i++) {
      for (int k = 0; k <= min(i, K); k++) {
        for (int j = 0; j <= i; j++) {
          if (i == 2 && k == 1 && j == 2) {
            int a = 0;
          }
          int flag = s[i - 1] == t[0];
          dp[i][k][j] = max(dp[i][k][j], dp[i - 1][k][j]);
          if (s[i - 1] == t[0]) {
            if (j > 0 && dp[i - 1][k][j - 1] != -inf)
              dp[i][k][j] = max(dp[i][k][j], dp[i - 1][k][j - 1]);
          }
          if (s[i - 1] == t[1]) {
            if (j - flag >= 0 && dp[i - 1][k][j - flag] != -inf)
              dp[i][k][j] = max(dp[i][k][j], dp[i - 1][k][j - flag] + j - flag);
          }
          if (k > 0 && j - 1 >= 0 && dp[i - 1][k - 1][j - 1] != -inf) {
            dp[i][k][j] = max(dp[i][k][j], dp[i - 1][k - 1][j - 1]);
          }
          int flag2 = t[1] == t[0];
          if (k > 0 && j - flag2 >= 0 && dp[i - 1][k - 1][j - flag2] != -inf) {
            dp[i][k][j] =
                max(dp[i][k][j], dp[i - 1][k - 1][j - flag2] + j - flag2);
          }
        }
      }
    }
    int res = 0;
    for (int i = 0; i <= K; i++) {
      for (int j = 0; j <= n; j++) res = max(res, dp[n][i][j]);
    }
    cout << res << endl;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  F ans;
  ans.solve();
  return 0;
}