#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int c = s[0];
  int ans = c - 'a' + 1;
  k--;
  for (int i = 1; i < n; i++) {
    if (k == 0) break;
    if (s[i] - c < 2) continue;
    c = s[i];
    ans += (c - 'a' + 1);
    k--;
  }
  if (k == 0)
    cout << ans << endl;
  else
    cout << -1 << endl;
  return 0;
}
