#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int kk = 0, m = 0;
  char c = 'a';
  sort(s.begin(), s.end());
  for (int i = 0; i < s.size() && kk < k; i++)
    if (s[i] - c > 1 || i == 0) {
      kk++;
      m += s[i] - 'a' + 1;
      c = s[i];
    }
  if (kk < k)
    cout << -1;
  else
    cout << m;
  return 0;
}
