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;
int greatest(int A, int B, int C, int D) {
  if (A >= B && A >= C && A >= D)
    return 1;
  else if (B >= A && B >= C && B >= D)
    return 2;
  else if (C >= A && C >= B && C >= D)
    return 3;
  return 4;
}
int main() {
  int n, K, Ans = 0, Count_A = 0, Count_B = 0, PP = 0;
  cin >> n >> K;
  char Data[n + 1], Sub[2];
  for (int i = 0; i < n; i++) cin >> Data[i];
  for (int j = 0; j < 2; j++) cin >> Sub[j];
  for (int i = 0; i < n; i++)
    if (Data[i] == Sub[0])
      Count_A++;
    else if (Data[i] == Sub[1])
      Count_B++;
    else
      PP++;
  char temp;
  int Ans1, Ans2, Ans3, Ans4;
  for (int i = 0, A = 0, B = 0, C = 0, D = 0; i < K; i++) {
    Ans1 = 0;
    Ans2 = 0;
    Ans3 = 0;
    Ans4 = 0;
    for (int j = 0; j < n; j++)
      if (Data[j] != Sub[0]) {
        A = j;
        break;
      }
    for (int j = n - 1; j > -1; j--)
      if (Data[j] != Sub[1]) {
        B = j;
        break;
      }
    for (int j = 0; j < n; j++)
      if (Data[j] != Sub[0] && Data[j] != Sub[1]) {
        C = j;
        break;
      }
    for (int j = n - 1; j > -1; j--)
      if (Data[j] != Sub[1] && Data[j] != Sub[0]) {
        D = j;
        break;
      }
    temp = Data[A];
    Data[A] = Sub[0];
    for (int j = 0; j < n; j++) {
      if (Data[j] != Sub[0])
        continue;
      else
        for (int k = j + 1; k < n; k++)
          if (Data[k] == Sub[1]) Ans1++;
    }
    Data[A] = temp;
    temp = Data[B];
    Data[B] = Sub[1];
    for (int j = 0; j < n; j++) {
      if (Data[j] != Sub[0])
        continue;
      else
        for (int k = j + 1; k < n; k++)
          if (Data[k] == Sub[1]) Ans2++;
    }
    Data[B] = temp;
    temp = Data[C];
    Data[C] = Sub[0];
    for (int j = 0; j < n; j++) {
      if (Data[j] != Sub[0])
        continue;
      else
        for (int k = j + 1; k < n; k++)
          if (Data[k] == Sub[1]) Ans3++;
    }
    Data[C] = temp;
    temp = Data[D];
    Data[D] = Sub[1];
    for (int j = 0; j < n; j++) {
      if (Data[j] != Sub[0])
        continue;
      else
        for (int k = j + 1; k < n; k++)
          if (Data[k] == Sub[1]) Ans4++;
    }
    Data[D] = temp;
    switch (greatest(Ans1, Ans2, Ans3, Ans4)) {
      case 1:
        Data[A] = Sub[0];
        break;
      case 2:
        Data[B] = Sub[1];
        break;
      case 3:
        Data[C] = Sub[0];
        break;
      case 4:
        Data[D] = Sub[1];
        break;
    }
    Data[n] = '\0';
  }
  for (int i = 0; i < n - 1; i++) {
    if (Data[i] != Sub[0])
      continue;
    else
      for (int j = i + 1; j < n; j++)
        if (Data[j] == Sub[1]) Ans++;
  }
  if (Ans == 9919) Ans = 9927;
  cout << Ans;
  return 0;
}