#include <bits/stdc++.h>
using namespace std;
class DSU {
 public:
  long long *parent, *cnt, *rank;
  long long sze;
  DSU(long long n) {
    rank = new long long[n + 1];
    parent = new long long[n + 1];
    cnt = new long long[n + 1];
    sze = n;
    for (long long i = 1; i <= n; i++) {
      parent[i] = i;
      rank[i] = 1;
      cnt[i] = 1;
    }
  }
  void join(long long a, long long b) {
    a = find(a);
    b = find(b);
    if (a != b) {
      sze--;
    }
    if (rank[a] > rank[b]) {
      parent[b] = a;
      cnt[a] += cnt[b];
      cnt[b] = 0;
    } else if (rank[a] < rank[b]) {
      parent[a] = b;
      cnt[b] += cnt[a];
      cnt[a] = 0;
    } else {
      parent[b] = a;
      cnt[a] += cnt[b];
      cnt[b] = 0;
      rank[a]++;
    }
  }
  long long find(long long a) {
    return a == parent[a] ? a : parent[a] = find(parent[a]);
  }
  bool check(long long a, long long b) { return find(a) == find(b); }
};
long long dp[101][101];
long long arr[2][101];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  string s1;
  cin >> s1;
  sort(s1.begin(), s1.end());
  long long tmp = 0;
  string ans = "";
  long long m = -1;
  for (long long i = 0; i < s1.size(); i++) {
    if (tmp == k) {
      break;
    }
    if (s1[i] - 'a' + 1 - m >= 2) {
      ans += s1[i];
      tmp++;
      m = s1[i] - 'a' + 1;
    }
  }
  if (tmp < k) {
    cout << "-1";
    return 0;
  }
  long long sol = 0;
  for (long long i = 0; i < ans.size(); i++) {
    sol += ans[i] - 'a' + 1;
  }
  cout << sol << '\n';
  return 0;
}
