#include <bits/stdc++.h>
using namespace std;
int main() {
  long t, n, k, i, j;
  char startLetter;
  vector<char> vec;
  cin >> n >> k;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  long minVal = INT_MAX;
  bool ans = false;
  if (k == 0) {
    cout << -1 << endl;
    return 0;
  }
  if (k == 1) {
    cout << (s[0] - 96) << endl;
    return 0;
  }
  vec.push_back(s[0]);
  for (j = 1; j < s.size(); j++) {
    long diff = (vec[vec.size() - 1]) - s[j];
    if (diff > 1 || diff < -1) {
      vec.push_back(s[j]);
    }
    if (vec.size() == k) {
      break;
    }
  }
  if (vec.size() != k) {
    cout << -1 << endl;
  } else {
    long thisVal = 0;
    for (auto elem : vec) {
      thisVal += (long)(elem - 96);
    }
    cout << thisVal << endl;
  }
  return 0;
}
