#include <bits/stdc++.h>
int n, k, sol, p, X[26];
char S[60];
int main() {
  scanf("%d%d%s", &n, &k, S);
  for (int i = 0; i <= n - 1; ++i) {
    X[S[i] - 'a'] = 1;
  }
  while ((k > 0) && (p <= 25)) {
    if (X[p]) {
      --k;
      sol += p + 1;
      p += 2;
    } else {
      ++p;
    }
  }
  if (k == 0)
    printf("%d", sol);
  else
    printf("-1");
  return 0;
}
