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.
from collections import defaultdict, deque, Counter
from heapq import heapify, heappop, heappush
import math
from copy import deepcopy
from itertools import combinations, permutations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right

import sys
def input():
    return sys.stdin.readline().rstrip()
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getListGraph():
    return list(map(lambda x:int(x) - 1, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]

mod = 10 ** 9 + 7
MOD = 998244353
# sys.setrecursionlimit(10000000)
inf = float('inf')
eps = 10 ** (-10)
dy = [0, 1, 0, -1]
dx = [1, 0, -1, 0]

#############
# Main Code #
#############

N, K = getNM()
S = list(input())
T = input()
t1, t2 = T[0], T[1]
if t1 == t2:
    for i in range(N - 1, -1, -1):
        if K and S[i] != t1:
            S[i] = t1
            K -= 1
    ans = 0
    cnt = 0
    for i in range(N):
        if S[i] == t1:
            ans += cnt
            cnt += 1
    print(ans)
    exit()

# 今までi個変換してこれより前にあるt1の個数がj個の時の連続部分列の個数
prev = [[-float('inf')] * (N + 1) for i in range(K + 1)]
prev[0][0] = 0
for n in range(N):
    next = [[-float('inf')] * (N + 1) for i in range(K + 1)]
    # 現在までに変換している個数
    for i in range(K + 1):
        # ここより前にあるt1の個数
        for j in range(N):
            # 変換しない
            next[i][j] = max(next[i][j], prev[i][j])
            # その文字がt1だった
            if S[n] == t1:
                next[i][j + 1] = max(next[i][j + 1], prev[i][j])
            # その文字がt2だった
            if S[n] == t2:
                # これより前のt1の個数だけカウント数が増える
                next[i][j] = max(next[i][j], prev[i][j] + j)

            # 変換する
            if i < K:
                # t1に変換
                next[i + 1][j + 1] = max(next[i + 1][j + 1], prev[i][j])
                # t2に変換
                next[i + 1][j] = max(next[i + 1][j], prev[i][j] + j)

    prev = next

print(max(prev[-1]))