#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  string s;
  cin >> n >> k >> s;
  set<char> st(s.begin(), s.end());
  string ans;
  for (char c : st) {
    if (ans.empty()) ans.push_back(c);
    if (ans.back() + 1 < c) ans.push_back(c);
    if ((int)ans.size() == k) break;
  }
  if ((int)ans.size() != k)
    cout << -1;
  else {
    int res = 0;
    for (char c : ans) res += c - 'a' + 1;
    cout << res << endl;
  }
}
