#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i, j, val, sum, count;
  cin >> n >> k;
  string s;
  cin >> s;
  for (i = 1; i < s.size(); i++) {
    j = i - 1;
    val = s[i];
    while (s[j] > val && j >= 0) {
      s[j + 1] = s[j];
      j--;
    }
    s[j + 1] = val;
  }
  count = 1;
  sum = s[0] - 'a' + 1;
  char ch = s[0];
  for (i = 1; i < n; i++) {
    if (count == k) break;
    if (s[i] - ch > 1) {
      count++;
      sum += s[i] - 'a' + 1;
      ch = s[i];
    }
  }
  if (count == k)
    cout << sum << endl;
  else
    cout << -1 << endl;
  return 0;
}
