#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 998244353;
int head[N];
int dis[N], ecnt;
int fa[N];
int cat[2005][2005];
long long gcd(long long a, long long b) {
  return a % b == 0 ? b : gcd(b, a % b);
}
long long qpow(long long base, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = (ans * base) % mod;
    n >>= 1;
    base = base * base % mod;
  }
  return ans;
}
struct Node {
  long long x, y;
} nde[N];
struct EDGE {
  int u, v, nxt;
  long long w;
} e[N];
bool cmp(EDGE a, EDGE b) { return a.w < b.w; }
void add_edge(int u, int v, long long w) {
  e[ecnt].u = u;
  e[ecnt].v = v;
  e[ecnt].w = w;
  e[ecnt].nxt = head[u];
  head[u] = ecnt++;
}
int fd(int x) { return -1 == fa[x] ? x : fa[x] = fd(fa[x]); }
long long m, n, x, k, a, b, c;
int vis[N];
int p[N], s[N];
int ct[N];
int ans = N;
int C[55][55];
int dp[150][150];
int ar[N], br[N];
struct H {
  int p, s;
  friend bool operator<(H a, H b) { return a.p < b.p; }
} he[N];
bool cmp(H a, H b) { return a.p < b.p; }
priority_queue<int> q;
vector<int> v;
map<vector<int>, int> mp;
int sum[N << 2], mi[N << 2], aa[N << 2];
void update(int l, int r, int i, int x, int pos) {
  if (l == r) {
    sum[i] = x;
    mi[i] = x;
    aa[i] = x;
    return;
  }
  int mid = l + r >> 1;
  if (pos <= mid)
    update(l, mid, i << 1, x, pos);
  else
    update(mid + 1, r, i << 1 | 1, x, pos);
  sum[i] = sum[i << 1] + sum[i << 1 | 1];
  mi[i] = min(mi[i << 1], sum[i << 1] + mi[i << 1 | 1]);
  aa[i] = max(aa[i << 1], sum[i << 1] + aa[i << 1 | 1]);
}
string ss;
void dfs(int cnt, int i, int aa, char la) {
  if (i > n) return;
  if (cnt == k) {
    ans = min(ans, aa);
    return;
  }
  if (ss[i] - la >= 2) {
    dfs(cnt + 1, i + 1, aa + ss[i] - 'a' + 1, ss[i]);
  }
  dfs(cnt, i + 1, aa, la);
}
int main() {
  {
    cin >> n >> k;
    cin >> ss;
    for (int i = 0; i <= n - 1; i++)
      for (int j = i + 1; j <= n - 1; j++)
        if (ss[i] > ss[j]) swap(ss[i], ss[j]);
    ss[n] = 'a';
    dfs(0, 0, 0, 'a' - 10);
    if (ans >= N) ans = -1;
    cout << ans << endl;
  }
  return 0;
}
