#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    if (n==1)
    {
        cout << 1 << endl;
        return 0;
    }
    if (n==2)
    {
        cout << 1 << " ";
        if (s=="aa" || s=="bb")
        {
            cout << 1 << endl;
            return 0;
        }
        cout << 2 << endl;
        return 0;
    }
    if (n==3)
    {
        cout << 1 << " ";
        if (s[0]==s[1])
        {
            cout << 1 << " ";
        }
        else
            cout << 2 << " ";
        string a=s.substr(0, 3);
        if (a=="aaa" || a=="bbb")
        {
            cout << 1 << endl;
            return 0;
        }
        cout << 2 << endl;
        return 0;
    }
    if (n==4)
    {
        cout << 1 << " ";
        if (s[0]==s[1])
        {
            cout << 1 << " ";
        }
        else
            cout << 2 << " ";
        string a=s.substr(0, 3);
        if (a=="aaa" || a=="bbb")
        {
            cout << 1 << " ";
        }
        else
        {
            cout << 2 << " ";
        }
        if (s=="aaaa" || s=="bbbb")
        {
            cout << 1 << endl;
            return 0;
        }
        else if (s=="abab" || s=="baab" || s=="abba" || s=="baba")
        {
            cout << 3 << endl;
            return 0;
        }
        cout << 2 << endl;
    }
    if (n==5)
    {
        cout << 1 << " ";
        if (s[0]==s[1])
        {
            cout << 1 << " ";
        }
        else
            cout << 2 << " ";
        string a=s.substr(0, 3);
        if (a=="aaa" || a=="bbb")
        {
            cout << 1 << " ";
        }
        else
        {
            cout << 2 << " ";
        }
        string b=s.substr(0, 4);
        if (b=="aaaa" || b=="bbbb")
        {
            cout << 1 << " ";
        }
        else if (b=="abab" || b=="baab" || b=="abba" || b=="baba")
        {
            cout << 3 << " ";
        }
        else
            cout << 2 << " ";
        if (s=="aaaaa" || s=="bbbbb")
        {
            cout << 1 << endl;
            return 0;
        }
        int bra=0, brb=0;
        for (int i=0; i<n; i++)
        {
            if (s[i]=='a') bra++;
            else brb++;
        }
        if (bra==4 || bra==1)
        {
            cout << 2 << endl;
            return 0;
        }
        if (s=="aabbb" || s=="aaabb" || s=="bbaaa" || s=="bbbaa")
        {
            cout << 2 << endl;
            return 0;
        }
        cout << 3 << endl;
        return 0;
    }
    return 0;
}