#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int add = 0;
  int curr = 0;
  int wei = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] > curr + 1) {
      curr = s[i];
      add++;
      wei += s[i] - 96;
    }
    if (add == k) {
      cout << wei << "\n";
      break;
    }
    if (i == s.size() - 1) {
      cout << "-1\n";
      break;
    }
  }
  return 0;
}
