#include <bits/stdc++.h>
using namespace std;
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int main() {
  long long int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  long long int ans = s[0] - 'a' + 1;
  long long int p = 0;
  long long int o = 1;
  for (long long int i = 1; i < s.length(); i++) {
    if (s[i] > s[p] + 1 && o < k) {
      ans = ans + (s[i] - 'a' + 1);
      o++;
      p = i;
    }
  }
  if (o < k) {
    cout << -1;
    return 0;
  }
  cout << ans;
  return 0;
}
