#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  string str;
  vector<char> v;
  cin >> n >> k;
  cin >> str;
  for (int i = 0; i < n; i++) {
    v.push_back(str[i]);
  }
  sort(v.begin(), v.end());
  int sum = v[0] - 'a' + 1;
  char last = v[0];
  int count = 1;
  int i = 1;
  while (count < k && i < n) {
    if (v[i] - last <= 1) {
      i++;
      continue;
    } else {
      sum += v[i] - 'a' + 1;
      count++;
      last = v[i++];
    }
  }
  if (count == k) {
    cout << sum << endl;
    ;
  } else {
    cout << -1 << endl;
  }
}
