#include <bits/stdc++.h>
using namespace std;
long long input() {
  char c = getchar();
  long long a = 0;
  bool neg = false;
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') neg = true, c = getchar();
  while (c >= '0' && c <= '9') a = a * 10 + (c - '0'), c = getchar();
  return neg ? -a : a;
}
const long long N = 100001;
const long long MOD = 1e6;
const long long MAX = 1e15;
int32_t main() {
  long long n = input(), k = input();
  string second;
  cin >> second;
  sort(second.begin(), second.end());
  char c = second[0];
  long long ans = c - 'a' + 1;
  while (--k) {
    auto it = lower_bound(second.begin(), second.end(), char(c + 2));
    if (it == second.end()) {
      cout << "-1";
      return 0;
    }
    c = *it;
    ans += c - 'a' + 1;
  }
  cout << ans << '\n';
  return 0;
}
