#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int n, k;
  cin >> n >> k;
  set<char> st;
  string s;
  cin >> s;
  for (int i = 0; i < n; ++i) st.insert(s[i]);
  int res = 0;
  char lastc = 0;
  int i;
  for (i = 0; i < k && !st.empty(); ++i) {
    auto it = st.begin();
    char c = *it;
    st.erase(it);
    if (*it - lastc < 2)
      --i;
    else {
      res += int(c - 'a' + 1);
      lastc = c;
    }
  }
  if (i == k)
    cout << res << "\n";
  else
    cout << -1 << "\n";
  return 0;
}
