#include <bits/stdc++.h>
using namespace std;
const int maxn = 60;
char str[maxn];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  scanf("%s", str);
  sort(str, str + n);
  int ans = str[0] - 'a' + 1, cnt = 1;
  char pre = str[0];
  for (int i = 1; i < n; i++) {
    if (str[i] - pre >= 2) {
      if (cnt >= k) break;
      ans += str[i] - 'a' + 1;
      pre = str[i];
      cnt++;
      if (cnt >= k) break;
    }
  }
  if (cnt < k) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", ans);
  return 0;
}
