#include <bits/stdc++.h>
using namespace std;
int cnt[30];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int res = 0;
  for (int i = 0; i < n; ++i) {
    char s;
    cin >> s;
    cnt[s - 'A']++;
  }
  int minn = INT_MAX;
  for (int i = 0; i < k; ++i) minn = min(cnt[i], minn);
  res += minn * k;
  for (int i = k; i < 30; ++i) res += cnt[i];
  cout << res << endl;
  return 0;
}
