#include <bits/stdc++.h>
using namespace std;
int n, k, v[300], a[300];
char s[100];
int main() {
  cin >> n >> k;
  cin >> s;
  int len = strlen(s);
  int ans = 0;
  for (int i = 0; i <= strlen(s) - 1; i++) a[s[i]]++;
  int o = 0;
  int now = 0;
  int vv = 0;
  while (o <= k) {
    vv = 0;
    for (int i = 'a'; i <= 'z'; i++)
      if (!v[i] && a[i] != 0 && i - now > 1) {
        ans += i - 'a' + 1;
        now = i;
        v[i] = 1;
        vv = 1;
        o++;
        break;
      }
    if (o == k) break;
    if (vv == 0) break;
  }
  if (vv == 0 && o != k)
    printf("-1\n");
  else
    printf("%d", ans);
  return (0);
}
