#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  map<char, int> mp;
  for (int i = 0; i < n; i++) mp[s[i]]++;
  sort(s.begin(), s.end());
  string aux = "";
  aux += s[0];
  int ans = aux[0] - 'a' + 1;
  mp[s[0]]--;
  while (aux.size() != k) {
    bool achou = false;
    int sz = aux.size() - 1;
    for (int i = 0; i < n; i++) {
      if (s[i] < aux[sz] + 2 or mp[s[i]] == 0) continue;
      achou = true;
      mp[s[i]]--;
      aux += s[i];
      ans += s[i] - 'a' + 1;
      break;
    }
    if (!achou) return puts("-1"), 0;
  }
  cout << ans << endl;
  return 0;
}
