Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be described by the string — concatenation of letters, which correspond to the stages.

There are $n$ stages available. The rocket must contain exactly $k$ of them. Stages in the rocket should be ordered by their weight. So, after the stage with some letter can go only stage with a letter, which is at least two positions after in the alphabet (skipping one letter in between, or even more). For example, after letter 'c' can't go letters 'a', 'b', 'c' and 'd', but can go letters 'e', 'f', ..., 'z'.

For the rocket to fly as far as possible, its weight should be minimal. The weight of the rocket is equal to the sum of the weights of its stages. The weight of the stage is the number of its letter in the alphabet. For example, the stage 'a 'weighs one ton,' b 'weighs two tons, and' z' — $26$ tons.

Build the rocket with the minimal weight or determine, that it is impossible to build a rocket at all. Each stage can be used at most once.


-----Input-----

The first line of input contains two integers — $n$ and $k$ ($1 \le k \le n \le 50$) – the number of available stages and the number of stages to use in the rocket.

The second line contains string $s$, which consists of exactly $n$ lowercase Latin letters. Each letter defines a new stage, which can be used to build the rocket. Each stage can be used at most once.


-----Output-----

Print a single integer — the minimal total weight of the rocket or -1, if it is impossible to build the rocket at all.


-----Examples-----
Input
5 3
xyabd

Output
29
Input
7 4
problem

Output
34
Input
2 2
ab

Output
-1
Input
12 1
abaabbaaabbb

Output
1


-----Note-----

In the first example, the following rockets satisfy the condition:



 "adx" (weight is $1+4+24=29$);

 "ady" (weight is $1+4+25=30$);

 "bdx" (weight is $2+4+24=30$);

 "bdy" (weight is $2+4+25=31$).

Rocket "adx" has the minimal weight, so the answer is $29$.

In the second example, target rocket is "belo". Its weight is $2+5+12+15=34$.

In the third example, $n=k=2$, so the rocket must have both stages: 'a' and 'b'. This rocket doesn't satisfy the condition, because these letters are adjacent in the alphabet. Answer is -1.

Difficulty: interview

Starter code:

Solutions:
n, k = map(int, input().split())
s = sorted(list(input()))
prev = 0
w = 0
for el in s:
	if k == 0:
		break
	if ord(el) >= prev + 2:
		k -= 1
		w += ord(el) - ord('a') + 1
		prev = ord(el)
if k == 0:
	print(w)
else:
	print(-1)

def main():
    n, m = list(map(int, input().split()))
    st = input()
    a = [0] * n
    for i in range(n):
        a[i] = ord(st[i]) - 96
    a.sort()
    ans = 0
    last = -1
    c = 0
    for i in range(n):
        if a[i] - last >= 2:
            c += 1
            last = a[i]
            ans += a[i]
        if c == m:
            print(ans)
            return
    print(-1)
main()


n, k = list(map(int, input().split()))
s = input()
d = [False] * 26
for c in s:
    d[ord(c) - ord('a')] = True
w = 0
l = 0
i = 0
while (i < 26) and (l < k):
    if d[i]:
        w += i + 1
        l += 1
        i += 2
    else:
        i += 1
if (l == k):
    print(w)
else:
    print(-1)


n,leng = list(map(int,input().split()))
s = input()
l = [0]*27

for c in s:
    l[ord(c)-ord('a')+1] += 1

i = 0
num = 0
out = 0
while i < 27 and num < leng:
    if l[i]:
        out += i
        i += 2
        num += 1
    else:
        i += 1

if num == leng:
    print(out)
else:
    print(-1)


import sys
import os


def solve(stages, k):
    s = dict()
    for char in stages:
        s[ord(char) - ord('a')] = True

    weight = 0
    current = 0
    last = -2
    for i in range(26):
        if i in s:
            if i >= last + 2:
                weight += i + 1
                current += 1
                last = i

        if current == k:
            break

    return -1 if current < k else weight

def main():
    n, k = map(int, input().split())
    stages = input()
    print(solve(stages, k))

def __starting_point():
    main()
__starting_point()

a,b = list(map(int,input().split()))
s = sorted(input())

last = '$'
cost = 0
used = 0

for c in s:
    if ord(c) - ord(last) > 1:
        cost += ord(c) - ord('a') + 1
        used += 1
        last = c
    if used == b:
        break

if used == b:
    print(cost)
else:
    print(-1)


n, k = list(map(int, input().split()))
s = input()
N = [False] * 26
for i in range(n):
    N[ord(s[i]) - 97] = True
c = 0
w = 0
i = 0
while i < 26:
    if N[i]:
        c += 1
        w += i + 1
        i += 1
    i += 1
    if c == k:
        break
if c == k:
    print(w)
else:
    print(-1)
        


n, k = list(map(int, input().split()))
a = [0] * 26
inn = input()
for i in inn:
    a[ord(i) - ord('a')] += 1
ans = 0
i = 0
anss = 0
while i < 26:
    if (a[i]):
        ans += 1
        anss += i + 1
        i += 1
    
    i += 1
    if (ans == k):
        break
    
if ans < k:
    print(-1)
else:
    print(anss)

n, k = map(int, input().split())
a = list(input())
a.sort()
c = ord('a') - 1
a = [ord(elem) - c for elem in a]
cur = -1
ans = 0
for i in range(n):
    if k == 0:
        break
    if a[i] > cur + 1:
        cur = a[i]
        ans += a[i]
        k -= 1
if k > 0:
    print(-1)
else:
    print(ans)

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

has = [ord(el) - 96 for el in sorted(s)]

ans = has[0]
last = ans
done = 1
i = 1

while i < n and done < k:
    if has[i] - 2 >= last:
        ans += has[i]
        last = has[i]
        done += 1

    i += 1

if done == k:
    print(ans)

else:
    print(-1)


from collections import defaultdict
import string

n, k = [int(i) for i in input().split()]
x = input()
d = {}
for i in string.ascii_lowercase:
    d[i] = i in x
i = 0
count = 0
while i < 26 and k > 0:
    if d[string.ascii_lowercase[i]]:
        count += i + 1
        i += 2
        k -= 1
    else:
        i += 1

if k > 0:
    print(-1)
else:
    print(count)


def read():
    return int(input())


def readmap():
    return list(map(int, input().split()))


def readlist():
    return list(map(int, input().split()))


def ctoi(c):
    return ord(c) - 96


n, k = readmap()
S = input()
stage = [0] * 27
for s in S:
    stage[ctoi(s)] = 1

ans = 0
i = 1
while k > 0 and i < 27:
    if stage[i]:
        ans += i
        k -= 1
        i += 2
    else:
        i += 1

if k > 0:
    print(-1)
else:
    print(ans)


n,k=map(int,input().split())
arr=sorted(list(input().strip()))
curr=0
ans=[ord(arr[0])-ord("a")]
for i in arr:
  if ord(i)-ord("a")-ans[len(ans)-1]>=2:
    ans.append(ord(i)-ord("a"))
if len(ans)<k:
  print(-1)
else:
  print(sum(ans[:k])+k)

n,k=input().strip().split(' ')
n,k=int(n),int(k)
s=input()
arr=[]
for i in s:
    arr.append(i)
arr.sort()
#print(arr)
wt=0
prev=-2
for i in arr:
    if(prev+2<=ord(i)-96):
        wt+=ord(i)-96
        prev=ord(i)-96
        k-=1
    if(not k):
        break
if(k):
    print(-1)
else:
    print(wt)


#input = open('a0.in').readline
n, k = map(int, input().split())
stages = sorted(input().strip())
i = 0
total = 0
last = -1
while k > 0 and i < n:
	wi = ord(stages[i]) - ord('a') +1
	if wi > last + 1:
		total += wi
		k -= 1
		last = wi

	i += 1

if k >0:
	print(-1)
else:
	print(total)

def main():
    n, k = [int(x) for x in input().split()]
    s = input()
    s = ''.join(sorted(s))

    count = 0
    last = None
    ans = 0

    for i, c in enumerate(s):
        if i == 0:
            last = c
            count += 1
            ans += ord(c) - 96

            if count == k:
                break

            continue

        if ord(c) - ord(last) < 2:
            continue

        last = c
        count += 1
        ans += ord(c) - 96

        if count == k:
            break

    else:
        print(-1)
        return

    print(ans)


def __starting_point():
    main()

__starting_point()

n, k = [int(c) for c in input().split(" ")]
line = [c for c in input()]
line.sort()

# print(line)

alphabet = "abcdefghijklmnopqrstuvwxyz"
alphabet_weight = {}
for i in range(len(alphabet)):
    alphabet_weight[alphabet[i]] = i+1

s = 0
p = 0
i = 0
previous_weight = -10000
while i < n:
    if alphabet_weight[line[i]] > previous_weight + 1:
        s += alphabet_weight[line[i]]
        previous_weight = alphabet_weight[line[i]]
        p += 1
    if p == k: break
    i += 1

if i == n: s = -1
print(s)


n,k = list(map(int,input().split()))

data = sorted(list(input()))

data = list([ord(x)-ord('a')+1 for x in data])

result = 0
used = 0
idx =0
prev = -2


# print(data)

for d in data:
    if d > prev+1:
        result+= d
        prev = d
        used += 1


    if used == k:
        break

if used < k:
    print(-1)
else:
    print(result)



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

s = list(sorted(s))
prv = 'Y'
cnt = 0
ans = 0
for c in s:
    if ord(prv) + 1 < ord(c):
        ans += ord(c) - ord('a') + 1
        prv = c
        cnt += 1
    if cnt == k:
        break

if cnt == k:
    print(ans)
else:
    print(-1)


na = list(map(int, input().split()))
s = input()

n = na[0]
k = na[1]

amk = 0
s = sorted(s)
last = -2
ans = 0
amdone = 0

for i in range(len(s)):
	if amdone == k:
		break
	if k + amk > n:
		print(-1)
		return
	if ord(s[i])-96 > last+1:
		last = ord(s[i])-96
		ans += ord(s[i])-96
		amdone += 1
	else:
		amk += 1

if k + amk > n:
	print(-1)
else:
    print(ans)


n, k = list(map(int, input().split()))
s = input()
def f(x):
	return (ord(x) - ord("a")) + 1
a = []
for i in s:
	a.append(i)
a.sort()
curr = 1
count = 1
ans = 0
last = 0
ans += f(a[0])
while curr < n and count < k:
	if f(a[curr]) - f(a[last]) >= 2:
		ans += f(a[curr])
		last = curr
		count += 1
	curr += 1
if count == k:
	print(ans)
else:
	print(-1)




import math

n, k = list(map(int, input().split()))
str = input()
l = []
for elem in str:
    l.append(elem)
l.sort()
stup = chr(97-2)
x = 0
xc = 0
flag = True
for i in range(n):
    if ord(stup)+1 < ord(l[i]):
        x+=1
        xc += ord(l[i]) - 96
        stup = l[i]
        if x == k:
            print(xc)
            flag = False
            break
if flag:
    print(-1)









n,k = list(map(int,input().split()))
s = input()
a = [0]*26
for i in range(n):
    a[ord(s[i])-97]= 1
uk = 0
su = 0
while(1):
    if a[uk] == 1:
        su+=uk+1
        uk+=2
        k-=1
    else:
        uk+=1
    if uk >= 26 or k==0:
        break
if k==0:print(su)
else : print(-1)


from sys import stdin
from math import *

line = stdin.readline().rstrip().split()
n = int(line[0])
k = int(line[1])
letters = stdin.readline().rstrip().split()

available = [False]*26

for c in letters[0]:
    available[ord(c)-ord('a')] = True

i = 0
cant = 0
accum = 0
while i < 26 and cant < k:
    if available[i]:
        cant+=1
        accum += (i+1)
        i += 1
    i += 1

if cant < k:
    print(-1)
else:
    print(accum)