#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, c, b, d, e, f = 0, g, k, l, i, j, u, m, p, n, t;
  string s;
  cin >> n >> k;
  cin >> s;
  l = s.size();
  map<int, int> mp;
  for (i = 0; i < l; i++) {
    mp[s[i]]++;
  }
  for (i = 'a'; i <= 'z' && k; i++) {
    if (mp[i] == 0)
      continue;
    else if (i < 'z' && mp[i] && mp[i + 1]) {
      f += i - 'a' + 1;
      k--;
      j = i + 1;
      i++;
    } else {
      f += i - 'a' + 1;
      k--;
    }
  }
  if (k > 0)
    cout << -1 << endl;
  else
    cout << f << endl;
  return 0;
}
