The only difference between the easy and the hard versions is constraints.

A subsequence is a string that can be derived from another string by deleting some or no symbols without changing the order of the remaining symbols. Characters to be deleted are not required to go successively, there can be any gaps between them. For example, for the string "abaca" the following strings are subsequences: "abaca", "aba", "aaa", "a" and "" (empty string). But the following strings are not subsequences: "aabaca", "cb" and "bcaa".

You are given a string s consisting of n lowercase Latin letters.

In one move you can take any subsequence t of the given string and add it to the set S. The set S can't contain duplicates. This move costs n - |t|, where |t| is the length of the added subsequence (i.e. the price equals to the number of the deleted characters).

Your task is to find out the minimum possible total cost to obtain a set S of size k or report that it is impossible to do so.

Input

The first line of the input contains two integers n and k (1 ≤ n, k ≤ 100) — the length of the string and the size of the set, correspondingly.

The second line of the input contains a string s consisting of n lowercase Latin letters.

Output

Print one integer — if it is impossible to obtain the set S of size k, print -1. Otherwise, print the minimum possible total cost to do it.

Examples

Input


4 5
asdf


Output


4


Input


5 6
aaaaa


Output


15


Input


5 7
aaaaa


Output


-1


Input


10 100
ajihiushda


Output


233

Note

In the first example we can generate S = { "asdf", "asd", "adf", "asf", "sdf" }. The cost of the first element in S is 0 and the cost of the others is 1. So the total cost of S is 4.
def count_subsequences_of_length(s):
    """文字列sの部分列を長さごとに数え上げる
    例) s = aba
    考えられる部分列は "", "a", "b", "ab", "ba", "aa", "aba" なので ans = [1, 2, 3, 1]
    計算量: O(len(s)*len(s)*len(alphabet))
    """
    n = len(s)
    alphabet = list(set(list(s)))
    to_int = {}
    for i, char in enumerate(alphabet):
        to_int[char] = i

    next_i = [[n] * len(alphabet) for i in range(n + 1)]
    for i in reversed(range(n)):
        for j, char in enumerate(alphabet):
            next_i[i][j] = next_i[i+1][j]
        next_i[i][to_int[s[i]]] = i

    # dp[i][j] := j番目までの文字を見たときの、長さiの部分列の通り数
    # 初期値はdp[0][0] = 1 (空文字 "" に対応)
    dp = [[0] * (n + 1) for i in range(n + 1)]
    dp[0][0] = 1
    for j in range(n):
        for i in range(n):
            for k in range(len(alphabet)):
                if next_i[j][k] >= n:
                    continue
                # 配るDP
                dp[i+1][next_i[j][k] + 1] += dp[i][j]

    ans = [sum(dp[i]) for i in range(n + 1)]
    return ans


n, k = map(int, input().split())
s = input()
ans_len = count_subsequences_of_length(s)

ans_cnt = 0
ans = 0
for length in reversed(range(len(ans_len))):
    cnt = ans_len[length]
    if ans_cnt + cnt <= k:
        ans_cnt += cnt
        ans += cnt * (n - length)
    else:
        ans += (k - ans_cnt) * (n - length)
        ans_cnt = k
if ans_cnt != k:
    print(-1)
else:
    print(ans)