#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int n, k, ans;
string str1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  if (n < k) {
    cout << -1;
    return 0;
  }
  cin >> str1;
  vector<char> str(n);
  for (int i = 0; i < n; i++) str[i] = str1[i];
  sort(str.begin(), str.end());
  char l_c = 'a';
  int step = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      l_c = str[0];
      ans += str[0] - 'a' + 1;
      step++;
    } else if ((str[i] - l_c) > 1) {
      l_c = str[i];
      step++;
      ans += str[i] - 'a' + 1;
    }
    if (step == k) break;
  }
  if (step < k) {
    cout << -1;
    return 0;
  } else
    cout << fixed << setprecision(0) << ans;
  return 0;
}
