#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, ans = 0, i = 1;
  int b[27] = {0};
  cin >> n >> k;
  string a;
  cin >> a;
  for (int i = 0; i < n; i++) {
    b[a[i] - 'a' + 1] = 1;
  }
  while (i < 27 && k) {
    if (b[i]) {
      k--;
      ans += i;
      i += 2;
    } else
      i++;
  }
  if (k)
    cout << "-1" << endl;
  else
    cout << ans << endl;
  return 0;
}
