#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
long long findGCD(vector<long long> arr, long long n) {
  long long result = arr[0];
  for (long long i = 1; i < n; i++) result = gcd(arr[i], result);
  return result;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(8);
  cout << fixed;
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  string ans = "";
  ans.push_back(s[0]);
  for (long long i = 1; i < s.size(); i++) {
    if (s[i] == ans[ans.size() - 1] || s[i] == (ans[ans.size() - 1] + 1)) {
    } else {
      ans.push_back(s[i]);
    }
  }
  if (ans.size() < k)
    cout << -1;
  else {
    long long sum = 0;
    for (long long i = 0; i < k; i++) {
      sum = sum + int(ans[i] - 'a') + 1;
    }
    cout << sum;
  }
  return 0;
}
