#include <bits/stdc++.h>
int main() {
  int i, j, sum, r, n, k;
  scanf("%d%d", &n, &k);
  char ch, str[n], str1[k];
  ch = getchar();
  gets(str);
  ch = str[0];
  for (i = 0; i < n; i++) {
    if (ch > str[i]) ch = str[i];
  }
  r = 0;
  while (1) {
    for (i = 0; i < n; i++) {
      if (ch == str[i]) {
        for (j = 0; j < r; j++) {
          if (str1[j] + 1 == ch) break;
        }
        if (j == r) {
          str1[r] = str[i];
          r++;
          break;
        }
      }
    }
    ch++;
    if (r == k || ch == 123) break;
  }
  if (r < k) {
    printf("%d\n", sum = -1);
    return 0;
  }
  sum = 0;
  for (i = 0; i < k; i++) {
    sum = sum + (str1[i] - 96);
  }
  printf("%d\n", sum);
  return 0;
}
