#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  map<char, int> mm;
  for (int i = 0; i < n; i++) {
    mm[s[i]]++;
  }
  int kol = 0;
  int res = 0;
  char last;
  for (auto q : mm) {
    if (kol == k) break;
    if (kol == 0) {
      last = q.first;
      res += (int)q.first - (int)'a' + 1;
      kol++;
    } else {
      if ((int)q.first != (int)last + 1) {
        last = q.first;
        res += (int)q.first - (int)'a' + 1;
        kol++;
      }
    }
  }
  if (kol < k) {
    cout << -1 << endl;
    return 0;
  }
  cout << res << endl;
  return 0;
}
