#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a < b; }
int main() {
  int a, b, i, j, k = 0, ans = 0;
  char x[10000], y[10000];
  scanf("%d %d", &a, &b);
  getchar();
  scanf("%s", &x);
  sort(x, x + a, cmp);
  for (i = 0; i < a; i++) {
    if (x[i] - 1 != y[k - 1] && x[i] != y[k - 1]) y[k++] = x[i];
    if (k >= b) break;
  }
  for (i = 0; i < k; i++) {
    ans += y[i] - 'a' + 1;
  }
  if (k != b)
    printf("-1\n");
  else {
    printf("%d\n", ans);
  }
  return 0;
}
