#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string str, ans_str;
  cin >> str;
  sort(str.begin(), str.end());
  int last = 90;
  bool fl = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if ((int)str[i] - last > 1) {
      ans += (int)(str[i] - 96);
      k--;
      last = (int)str[i];
    }
    if (k == 0) {
      fl = true;
      break;
    }
  }
  if (fl) {
    cout << ans << endl;
  } else
    cout << -1 << endl;
  return 0;
}
