#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 p = 0;
  int ans = 0;
  char ch = 'a' - 2;
  for (int i = 0; i < n; i++) {
    if (s[i] >= ch + 2) {
      ch = s[i];
      ans += s[i] - 'a' + 1;
      p++;
      if (p == k) {
        cout << ans << endl;
        return 0;
      }
    }
  }
  cout << "-1";
}
