#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  cin >> n >> k;
  string s;
  cin >> s;
  string alpha = "abcdefghijklmnopqrstuvwxyz";
  map<char, int> mp;
  for (int i = 0; i < alpha.size(); i++) mp[alpha[i]] = i + 1;
  int res = 0;
  vector<char> v;
  for (int i = 0; i < s.size(); i++) v.push_back(s[i]);
  sort(v.begin(), v.end());
  int i = 0;
  int x = 0;
  stack<char> st;
  while (i < n && x < k) {
    if (st.empty()) {
      st.push(v[i]);
      x++;
      res += mp[v[i]];
    } else if (mp[v[i]] - mp[st.top()] > 1) {
      st.push(v[i]);
      x++;
      res += mp[v[i]];
    }
    i++;
  }
  if (x < k)
    cout << "-1";
  else
    cout << res;
}
