#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int n, k, rpta, count;
  char letra, cad[55];
  cin >> n >> k;
  cin >> cad;
  sort(cad, cad + n);
  count = 1;
  rpta = cad[0] - 96;
  letra = cad[0];
  for (int i = 0; i < n; i++) {
    if (count == k) break;
    if ((cad[i] - letra) > 1) {
      ++count;
      rpta += cad[i] - 96;
      letra = cad[i];
    }
  }
  if (count != k) rpta = -1;
  cout << rpta << endl;
  return 0;
}
