#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define FAST ios::sync_with_stdio(false);cout.tie(0);cin.tie(0);

#define ff(i,a,b) for(int (i) = (a);(i)<(b);(i)++)
#define fff(i,a,b) for(int (i) = (a);(i)<=(b);(i)++)
#define bff(i,a,b) for(int (i) = (a);(i)>(b);(i)++)
#define bfff(i,a,b) for(int (i) = (a);(i)>=(b);(i)++)

#define pb push_back
#define F first
#define S second

using namespace std;
using namespace __gnu_pbds;

typedef long long int lli;

int main()
{
    FAST
    int n; cin>>n;
    int k; cin>>k;
    bool viewed['a'+ k+2];
    memset(viewed,0,sizeof(viewed));
    char curr,reset = 0;
    bool viewedall=false;
    int counter = 1;
    ff(i,0,n){
        cin>>curr;
        if(!viewed[curr]){
            viewed[curr] = true;
            viewedall=true;
            ff(i,'a','a'+k){
                if(!viewed[i]){
                    viewedall = false;
                }
            }
            if(viewedall){
                counter++;
                memset(viewed,0,sizeof(viewed));
            }
        }
        cout<<counter<<endl;

    }
    return 0;
}