using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.IO;
using System.Text;

partial class Program {
	static void minimize<T>(ref T a, T b) where T : IComparable<T> {
		if (a.CompareTo(b) > 0) a = b;
	}
	static void maximize<T>(ref T a, T b) where T : IComparable<T> {
		if (a.CompareTo(b) < 0) a = b;
	}

	static void write<T>(List<T> list) {
		for (var i = 0 ; i < list.Count ; i++) {
			Console.Write(list[i]);
			if (i != list.Count - 1) Console.Write(' ');
		}
	}

	static Scanner scanner = new Scanner(Console.In, false);

	static void Main() {
		var n = scanner.NextInt();
		var s = scanner.NextLine();

		var a = new List<int>(n);
		a.AddRange(Enumerable.Repeat(1, n));
		for (int j = 0 ; j < n ; j++) {
			for (int i = 0 ; i < s.Length ; i++) {
				if (s[i] == 'L') a[i] = Math.Max(a[i], a[i + 1] + 1);
				else if (s[i] == 'R') a[i + 1] = Math.Max(a[i] + 1, a[i + 1]);
				else {
					a[i] = a[i + 1] = Math.Max(a[i], a[i + 1]);
				}
			}
		}

		write(a);
	}
}

class Scanner {
	private readonly string s;
	int _length, _pos;

	public Scanner( TextReader reader, int bufferSize, bool closeReader )
	{
		s = reader.ReadToEnd();
		_length = s.Length;
	}

	public Scanner( TextReader reader, bool closeReader ) : this( reader, 1 << 16, closeReader ) { }

	public Scanner( string fileName ) : this( new StreamReader( fileName, Encoding.Default ), true ) { }

	public bool Eof
	{
		get
		{
			return _pos == s.Length;
			FillBuffer( false );
			return _pos >= _length;
		}
	}

	private char NextChar()
	{
		return s[_pos++];
	}

	private char PeekNextChar()
	{
		return s[_pos];
	}

	private void FillBuffer( bool throwOnEof )
	{
	}

	public int NextInt()
	{
		var neg = false;
		int res = 0;
		SkipWhitespaces();
		if ( !Eof && PeekNextChar() == '-' )
		{
			neg = true;
			_pos++;
		}
		while ( !Eof && !IsWhitespace( PeekNextChar() ) )
		{
			var c = NextChar();
			if ( c < '0' || c > '9' ) throw new ArgumentException( "Illegal character" );
			res = 10 * res + c - '0';
		}
		return neg ? -res : res;
	}

	public long NextLong()
	{
		var neg = false;
		long res = 0;
		SkipWhitespaces();
		if ( !Eof && PeekNextChar() == '-' )
		{
			neg = true;
			_pos++;
		}
		while ( !Eof && !IsWhitespace( PeekNextChar() ) )
		{
			var c = NextChar();
			if ( c < '0' || c > '9' ) throw new ArgumentException( "Illegal character" );
			res = 10 * res + c - '0';
		}
		return neg ? -res : res;
	}

	public string NextLine()
	{
		SkipUntilNextLine();
		if ( Eof ) return "";
		var builder = new StringBuilder();
		while ( !Eof && !IsEndOfLine( PeekNextChar() ) )
		{
			builder.Append( NextChar() );
		}
		return builder.ToString();
	}

	public double NextDouble()
	{
		SkipWhitespaces();
		var builder = new StringBuilder();
		while ( !Eof && !IsWhitespace( PeekNextChar() ) )
		{
			builder.Append( NextChar() );
		}
		return double.Parse( builder.ToString(), CultureInfo.InvariantCulture );
	}

	private void SkipWhitespaces()
	{
		while ( !Eof && IsWhitespace( PeekNextChar() ) )
		{
			++_pos;
		}
	}

	private void SkipUntilNextLine()
	{
		while ( !Eof && IsEndOfLine( PeekNextChar() ) )
		{
			++_pos;
		}
	}

	private static bool IsWhitespace( char c )
	{
		return c == ' ' || c == '\t' || c == '\n' || c == '\r';
	}

	private static bool IsEndOfLine( char c )
	{
		return c == '\n' || c == '\r';
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;
            var ans = Enumerable.Repeat<int>(1, n).ToArray() ;
            for (var i = 0; i < len; i++)
            {
                if (s[i] == 'L')
                {
                    var j = i;
                    while (j >= 0 && s[j] == 'L')
                    {
                        ans[j] = ans[j + 1] + 1;
                        j--;
                    }

                }
                else if (s[i] == 'R')
                {
                    ans[i + 1] = ans[i] + 1;
                }
                else
                {
                    var newVal = Math.Max(ans[i], ans[i + 1]);
                    ans[i] = ans[i + 1] = newVal;
                }
            }
            foreach (var i in ans)
            {
                Console.Out.Write(i + " ");
            }
            Console.ReadLine();
        }

        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(' ').ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;
            var ans = Enumerable.Repeat<int>(1, n).ToArray();
            for (var i = 0; i < len; i++)
            {
                if (s[i] == 'L')
                {
                    ans[i] = ans[i + 1] + 1;
                }
                else if (s[i] == 'R')
                {
                    ans[i+1] = ans[i] + 1;
                }
                else
                {
                    var newVal = Math.Max(ans[i], ans[i + 1]);
                    ans[i] = ans[i + 1] = newVal;
                }
            }
            foreach (var i in ans) {
                Console.Out.Write(i + " ");
            }
            Console.ReadLine();
        }

        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(' ').ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;
            var ans = new int[n];
            ans[0] = 1;
            int min = ans[0];
            for (var i = 0; i < len; i++)
            {
                if (s[i] == 'L')
                {
                    ans[i + 1] = ans[i] - 1;
                }
                else if (s[i] == 'R')
                {
                    ans[i + 1] = ans[i] + 1;
                }
                else
                {
                    ans[i + 1] = ans[i];
                }
                min = Math.Min(min, ans[i + 1]);
            }
            foreach (var i in ans)
            {
                Console.Out.Write((i - min + 1) + " ");
            }
            Console.ReadLine();
        }

        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(' ').ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;
            var ans = Enumerable.Repeat<int>(1, n).ToArray();
            for (var i = 0; i < len; i++)
            {
                if (s[i] == 'L')
                {
                    var j = i;
                    while (j >= 0 && s[j] == 'L')
                    {
                        if (ans[j] < ans[j + 1] + 1)
                            ans[j] = ans[j + 1] + 1;
                        j--;
                    }

                }
                else if (s[i] == 'R')
                {
                    ans[i + 1] = ans[i] + 1;
                }
                else
                {
                    var newVal = Math.Max(ans[i], ans[i + 1]);
                    ans[i] = ans[i + 1] = newVal;
                }
            }
            foreach (var i in ans)
            {
                Console.Out.Write(i + " ");
            }
            Console.ReadLine();
        }

        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(' ').ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;

            for (
                var i = 0; i < n; i++)
            {
                int left = 1;
                int right = 1;
                for (int j = i; j < len; j++)
                {

                    if (s[j] == 'L')
                    {
                        left++;
                    }
                    if(s[j] == 'R')
                    {
                        break;
                    }
                }

                for (int j = i - 1; j >= 0; j--)
                {
                    if (s[j] == 'R')
                    {
                        right++;
                    }
                    if (s[j] == 'L')
                    {
                        break;
                    }
                }
                Console.Out.Write(Math.Max(left, right) + " ");
            }

            Console.ReadLine();
        }

        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(' ').ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;

            for (var i = 0; i < n; i++)
            {
                int left = 1;
                int right = 1;
                for (int j = i; j < len; j++)
                {

                    if (s[j] == 'L')
                    {
                        left++;
                    }
                    else
                    {
                        break;
                    }
                }

                for (int j = i - 1; j >= 0; j--)
                {
                    if (s[j] == 'R')
                    {
                        right++;
                    }
                    else
                    {
                        break;
                    }
                }
                Console.Out.Write(Math.Max(left, right) + " ");
            }

            Console.ReadLine();
        }

        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(' ').ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learning
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var s = Next();
            var len = s.Length;

            for (
                var i = 0; i < n; i++)
            {
                int left = 1;
                int right = 1;
                for (int j = i; j < len; j++)
                {

                    if (s[j] == 'L')
                    {
                        left++;
                    }
                    if(s[j] == 'R')
                    {
                        break;
                    }
                }

                for (int j = i - 1; j >= 0; j--)
                {
                    if (s[j] == 'R')
                    {
                        right++;
                    }
                    if (s[j] == 'L')
                    {
                        break;
                    }
                }
                Console.Out.Write(Math.Max(left, right) + " ");
            }

            Console.ReadLine();
        }

        static int s_index = 0;
        static string[] s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Length)
            {
                s_tokens = Console.ReadLine().Split(' ').ToArray();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        private static int NextInt()
        {
            return Int32.Parse(Next());
        }

        private static long NextLong()
        {
            return Int64.Parse(Next());
        }
    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            Fun(s, n);

        }

        static public void Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 1;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            for (int i = 0; i < res.Length -1; i++ ) {
                //for (int j = 1; j < res.Length; j++) {
                //if (str[i] == '=') { continue; }
                if (str[i] == 'R')
                {

                        if (res[i] >= res[i + 1])
                            while (res[i] >= res[i + 1])
                                res[i + 1]++;

                }
                else if (str[i] == 'L')
                {
                    if (i != 0)
                    {
                        if (res[i] <= res[i + 1]) res[i]++;
                    }
                    else res[i]++;
                }
                //}
            }
            for (int i = 0; i < res.Length; i++ ) {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] > res[i + 1])

                                res[i + 1] = res[i];
                            else if (res[i] < res[i + 1])
                                res[i] = res[i + 1];
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            Fun(s, n);

        }

        static public void Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 1;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            for (int i = 0; i < res.Length -1; i++ ) {
                //for (int j = 1; j < res.Length; j++) {
                if (str[i] == '=') {
                    if (res[i] >= res[i + 1])
                        while (res[i] > res[i + 1])
                            res[i + 1]++;
                }
                if (str[i] == 'R')
                {

                        if (res[i] >= res[i + 1])
                            while (res[i] >= res[i + 1])
                                res[i + 1]++;

                }
                else if (str[i] == 'L')
                {
                    if (i != 0)
                    {
                        if (res[i] <= res[i + 1]) res[i]++;
                    }
                    else res[i]++;
                }
                //}
            }
            for (int i = 0; i < res.Length; i++ ) {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] >= res[i + 1])
                                while (res[i] > res[i + 1])
                                    res[i + 1]++;
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] > res[i + 1])
                                while (res[i] > res[i + 1])
                                    res[i + 1]++;
                            else if (res[i] < res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;
                            else if (res[i - 1] > res[i])
                                while (res[i - 1] > res[i])
                                    res[i]++;
                            else if (res[i -1] < res[i])
                                while (res[i-1] <= res[i])
                                    res[i-1]++;
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (i == 0) { continue; }
                            else if (res[i] > res[i + 1])
                                while (res[i] > res[i + 1])
                                    res[i + 1]++;
                            else if (res[i] < res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;
                            else if (res[i - 1] > res[i])
                                while (res[i - 1] > res[i])
                                    res[i]++;
                            else if (res[i - 1] < res[i])
                                while (res[i - 1] <= res[i])
                                    res[i - 1]++;
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            Fun(s, n);

        }

        static public void Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 1;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            for (int i = 0; i < res.Length -1; i++ ) {
                //for (int j = 1; j < res.Length; j++) {
                if (str[i] == '=') {
                    if (res[i] >= res[i + 1])
                        while (res[i] > res[i + 1])
                            res[i + 1]++;
                }
                if (str[i] == 'R')
                {

                        if (res[i] >= res[i + 1])
                            while (res[i] >= res[i + 1])
                                res[i + 1]++;

                }
                else if (str[i] == 'L')
                {

                        if (res[i] <= res[i + 1])
                            while (res[i] <= res[i+1])
                                res[i]++;

                }
                //}
            }
            for (int i = 0; i < res.Length; i++ ) {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] >= res[i + 1])
                                while (res[i] > res[i + 1])
                                    res[i + 1]++;
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] > res[i + 1])
                                while (res[i] > res[i + 1])
                                    res[i + 1]++;
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)

    {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 1; i < res.Length - 1; i++,j++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[j] == '=')
                        {
                            if (res[i-1] > res[i])
                                while (res[i-1] > res[i])
                                    res[i]++;
                            if (res[i-1] < res[i])
                                while (res[i-1] <= res[i])
                                    res[i-1]++;
                        }
                        if (str[j] == 'R')
                        {

                            if (res[i-1] >= res[i])
                                while (res[i-1] >= res[i])
                                    res[i]++;

                        }
                        else if (str[j] == 'L')
                        {

                            if (res[i-1] <= res[i])
                                while (res[i-1] <= res[i])
                                    res[i-1]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] > res[i + 1])
                                while (res[i] > res[i + 1])
                                    res[i + 1]++;
                            if (res[i] < res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)

    {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = "=RL=L=RLRLRRRLR=RR=LRL=L===RR";
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 1; i < res.Length - 1; i++,j++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[j] == '=')
                        {
                            if (res[i-1] > res[i])
                                while (res[i-1] > res[i])
                                    res[i]++;
                            if (res[i-1] < res[i])
                                while (res[i-1] <= res[i])
                                    res[i-1]++;
                        }
                        if (str[j] == 'R')
                        {

                            if (res[i-1] >= res[i])
                                while (res[i-1] >= res[i-])
                                    res[i]++;

                        }
                        else if (str[j] == 'L')
                        {

                            if (res[i-1] <= res[i])
                                while (res[i-1] <= res[i])
                                    res[i-1]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i + 1;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int w = 0; w < res.Length; w++ )
                    for (int i = 0; i < res.Length - 1; i++)
                    {
                        //for (int j = 1; j < res.Length; j++) {
                        if (str[i] == '=')
                        {
                            if (res[i] > res[i + 1])
                                res[i + 1] = res[i];
                            else if (res[i] < res[i + 1])
                                res[i] = res[i + 1];
                        }
                        if (str[i] == 'R')
                        {

                            if (res[i] >= res[i + 1])
                                while (res[i] >= res[i + 1])
                                    res[i + 1]++;

                        }
                        else if (str[i] == 'L')
                        {

                            if (res[i] <= res[i + 1])
                                while (res[i] <= res[i + 1])
                                    res[i]++;

                        }
                        //}
                    }
            }
            return res;
        }

    }
}


using System;

namespace Olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            int [] res = Fun(s, n);

            for (int i = 0; i < res.Length; i++)
            {
                Console.Write(res[i]);
                if (i != res.Length - 1) Console.Write(" ");

            }
        }

        static public int [] Fun(string str, int n)
        {
            int[] res = new int[n]; int j = 0;
            for (int i = 0; i < res.Length; i++)
                res[i] = 1;
            if (str.Contains("=") && !str.Contains("R") && !str.Contains("L")) return res;
            else if (!str.Contains("=") && str.Contains("R") && !str.Contains("L"))
                for (int i = 0; i < res.Length; i++)
                    res[i] = i;
            else if (!str.Contains("=") && !str.Contains("R") && str.Contains("L"))
                for (int i = res.Length; i > 0; i--, j++)
                    res[j] = i;
            else
            {
                for (int i = 0; i < res.Length - 1; i++)
                {
                    //for (int j = 1; j < res.Length; j++) {
                    if (str[i] == '=')
                    {
                        if (res[i] >= res[i + 1])
                            while (res[i] > res[i + 1])
                                res[i + 1]++;
                    }
                    if (str[i] == 'R')
                    {

                        if (res[i] >= res[i + 1])
                            while (res[i] >= res[i + 1])
                                res[i + 1]++;

                    }
                    else if (str[i] == 'L')
                    {

                        if (res[i] <= res[i + 1])
                            while (res[i] <= res[i + 1])
                                res[i]++;

                    }
                    //}
                }
            }
            return res;
        }

    }
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define F first
#define S second
#define all(x) (x).begin(),(x).end()

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> v(n,0);
    v[0] = 1;
    cin.ignore();
    for(int i = 1; i < n ; i++){
        char c;cin.get(c);
        if(c == '='){
            v[i] = v[i-1];
        }else if(c == 'L'){
            v[i] = min(v[i-1]-1,1);
        }else{
            v[i] = v[i-1]+1;
        }
        if(v[i] < 1){
            v[i]++;
            for(int j = i-1 ; j >= 0 ; j--){
                if(v[j] > v[j+1] || v[j] < v[j+1]-1)break;
                v[j]++;
            }
        }
    }

    for(int i = 0 ; i < n; i++){
        cout << v[i] << " ";
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define F first
#define S second
#define all(x) (x).begin(),(x).end()

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> v(n,0);
    v[0] = 1;
    cin.ignore();
    for(int i = 1; i < n ; i++){
        char c;cin.get(c);
        if(c == '='){
            v[i] = v[i-1];
        }else if(c == 'L'){
            v[i] = min(v[i-1]-1,1);
        }else{
            v[i] = v[i-1]+1;
        }
        if(v[i] < 1){
            v[i]++;
            for(int j = i-1 ; j >= 0 ; j--){
                if(v[j] > v[j+1])break;
                v[j]++;
            }
        }
    }

    for(int i = 0 ; i < n; i++){
        cout << v[i] << " ";
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define F first
#define S second
#define all(x) (x).begin(),(x).end()

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> v(n,0);
    v[0] = 1;
    cin.ignore();
    for(int i = 1; i < n ; i++){
        char c;cin.get(c);
        if(c == '='){
            v[i] = v[i-1];
        }else if(c == 'L'){
            v[i] = min(v[i-1]-1,1);
        }else{
            v[i] = v[i-1]+1;
        }
        if(v[i] < 1){
            v[i]++;
            for(int j = i-1 ; j >= 0 ; j--){
                if(v[j] > v[j+1] || v[j] < v[j+1])break;
                v[j]++;
            }
        }
    }

    for(int i = 0 ; i < n; i++){
        cout << v[i] << " ";
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define F first
#define S second
#define all(x) (x).begin(),(x).end()

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> v(n,0);
    v[0] = 1;
    cin.ignore();
    for(int i = 1; i < n ; i++){
        char c;cin.get(c);
        if(c == '='){
            v[i] = v[i-1];
        }else if(c == 'L'){
            v[i] = v[i-1]-1;
        }else{
            v[i] = v[i-1]+1;
        }
        if(v[i] < 1){
            for(int j = i ; j >= 0 ; j--){
                v[j]++;
            }
        }
    }

    for(int i = 0 ; i < n; i++){
        cout << v[i] << " ";
    }
}


//ITNOG
#include <bits/stdc++.h>

using namespace std;
#define int long long

const int maxN = 1000 + 5;
const int mod = 1000*1000*1000 + 7;
int a[maxN];
main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int n; cin >> n;
    string s; cin >> s;
    fill(a, a + n, 1);
    for(int i = 2; i <= n; i ++)
	  for(int j = 0; j < n; j ++)
	  {
		if(j < n - 1)
		{
		    if(s[j] == 'L' && a[j] <= a[j + 1]) a[j] ++;
		    if(s[j] == '=' && a[j] < a[j + 1]) a[j] ++;
		}

		if(!j) continue;
		if(s[j - 1] == 'R' && a[j] <= a[j - 1]) a[j] ++;
		if(s[j - 1] == '=' && a[j] < a[j - 1]) a[j] ++;
	  }
    for(int i = 0; i < n; i ++)
	  cout << a[i] << ' ';
    cout << endl;
    return 0;

}


#include<iostream>
#include <algorithm>
using namespace std;
int main ()
{
	int n,m;
	while (cin>>n>>m)
	{
		int max=0,flag=1, r[50000] = {0};
		char c[50000] = { 0 };
		for (int i = 0; i < n; i++)
			cin >> c[i];
		for (int i = 1; i < n; i++)
		{
			if (flag&&c[i]==c[i-1])
			{
				r[c[i] - 'a']++;
				flag = 0;
				continue;
			}
			flag = 1;
		}
		sort(r, r + 26);
		cout << r[25] << endl;
	}
	return 0;
}


#include<iostream>
#include <algorithm>
using namespace std;
int main ()
{
	int n, m, r[30] = { 0 }, num = 0, Max = 0;
    char c[50000] = {0};
    cin >> n >> m>>c;
    for (int i = 1; i <= n; i++)
    {
        if (i != 1 && c[i] != c[i - 1])
        {
            r[c[i - 1] - 'a'] += num / m;
            num = 0;
        }
            num++;
    }
    r[c[n] - 'a'] += num / m;
    for (int j = 0; j < 26; j++)
        Max = max(Max, r[j]);
    cout << Max << endl;
	return 0;
}


#include<cstdio>
#define MOD 998244353
char word[200005];
int main()
{
    int n;
    scanf("%d",&n);
    scanf("%s",word);
    int l,r;
    l=0,r=n-1;
    for(int i=0;i<n;++i)
    {
        if(word[l]==word[0])
            l++;
        else
            break;
    }
    for(int i=0;i<n;++i)
    {
        if(word[r]==word[n-1])
            r--;
        else
            break;
    }
    if(n==1)
    {
        printf("1\n");
        return 0;
    }
    if(n==2)
    {
        printf("3\n");
        return 0;
    }
    if(r<l&&r==l-1)
    {
        printf("%d\n",(n+1)%MOD);
        return 0;
    }
    if(r<l&&word[0]==word[n-1])
    {
        printf("%d\n",(n*(n+1)/2)%MOD);
        return 0;
    }
    if(r>=l)
    {
        if(word[0]==word[n-1])
        {
            printf("%d\n",((l+1)%MOD)*((n-r)%MOD)%MOD);
            return 0;
        }
        else
        {
            printf("%d\n",(((l+1)%MOD)+((n-r-1)%MOD))%MOD);
            return 0;
        }
    }
}


/*徐嘉浩 AK NOIP
徐嘉浩 AK ZJOI
徐嘉浩 AK APIO
徐嘉浩 AK WC
徐嘉浩 AK CTSC
徐嘉浩 AK NOI
徐嘉浩 AK IOI*/
#include<bits/stdc++.h>
using namespace std;
int n,k,m,a[200005],ans,sum;
char c[200005];
int main()
{
	cin>>n>>k;
	cin>>c+1;
	for(int i=1;i<=n;i++)a[i]=c[i]-96;
	for(int i=1;i<=26;i++)
	{
		m=0;sum=0;
		for(int j=1;j<=n;j++)
		{
			if(a[j]==i)m++;
			else m=0;
			if(m==k){sum++;m=0;}
		}
		ans=max(ans,sum);
	}
	cout<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define quick ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
int main()
{
	quick;
	int n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	s="#"+s+"#";
	int x=0;
	for(char c='a';c<='z';c++)
	{
		int cx=0;
		for(int i=1;i<=n;i++)
			if(s[i]==c)
			{
				int j=i;
				while(s[j+1]==c)
					++j;
				cx+=(j-i+1)/k;
				i=j;
			}
		x=max(x,cx);
	}
	cout<<x<<endl;
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn=2e5+100;
int n,k;
char s[maxn];
int ans[26];
int main(){
    scanf("%d%d",&n,&k);
    scanf("%s",s+1);
    int num=1;
    for(int i=1;i<=n;i++){
        if(s[i]!=s[i-1]||num==k){
            if(num==k){
                ans[s[i-1]-'a']++;
            }
            num=1;
        }else{
            num++;
        }
    }
    int ANS=0;
    for(int i=0;i<26;i++)
        ANS=max(ANS,ans[i]);
    printf("%d\n",ANS);
return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn=2e5+100;
int n,k;
char s[maxn];
int ans[26];
int main(){
    scanf("%d%d",&n,&k);
    scanf("%s",s);
    int num=1;
    for(int i=0;i<n;i++){
        if(s[i]!=s[i-1]||num==k){
            if(num==k){
                ans[s[i-1]-'a']++;
            }
            num=1;
        }else{
            num++;
        }
    }
    int ANS=0;
    for(int i=0;i<26;i++)
        ANS=max(ANS,ans[i]);
    printf("%d\n",ANS);
return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn=2e5+100;
int n,k;
char s[maxn];
int ans[27];
int main(){
    scanf("%d%d",&n,&k);
    scanf("%s",s+1);
    int num=1;
    if(k==1){
        for(int i=1;i<=n;i++)
            ans[s[i]-'a']++;
    }else{
        for(int i=1;i<=n;i++){
            if(s[i]!=s[i-1]||num==k){
                if(num==k&&i!=1){
                    ans[s[i-1]-'a']++;
                }
                num=1;
            }else{
                num++;
            }
        }
    }
    int ANS=0;
    for(int i=0;i<26;i++)
        ANS=max(ANS,ans[i]);
    printf("%d\n",ANS);
return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn=2e5+100;
int n,k;
char s[maxn];
int ans[27];
int main(){
    scanf("%d%d",&n,&k);
    scanf("%s",s+1);
    int num=1;
    if(k==1){
        printf("%d\n",n);
    }else{
        for(int i=1;i<=n;i++){
            if(s[i]!=s[i-1]||num==k){
                if(num==k&&i!=1){
                    ans[s[i-1]-'a']++;
                }
                num=1;
            }else{
                num++;
            }
        }
        int ANS=0;
        for(int i=0;i<26;i++)
            ANS=max(ANS,ans[i]);
        printf("%d\n",ANS);
    }
return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn=2e5+100;
int n,k;
char s[maxn];
int ans[27];
int main(){
    scanf("%d%d",&n,&k);
    scanf("%s",s+1);
    int num=1;
    if(k==1){
        for(int i=1;i<=n;i++)
            ans[s[i]-'a']++;
    }else{
        for(int i=1;i<=n+1;i++){
            if(s[i]!=s[i-1]||num==k){
                if(num==k&&i!=1){
                    ans[s[i-1]-'a']++;
                }
                num=1;
            }else{
                num++;
            }
        }
    }

    int ANS=0;
    for(int i=0;i<26;i++)
        ANS=max(ANS,ans[i]);
    printf("%d\n",ANS);
return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn=2e5+100;
int n,k;
char s[maxn];
int ans[27];
int main(){
    scanf("%d%d",&n,&k);
    scanf("%s",s+1);
    int num=1;
    for(int i=1;i<=n;i++){
        if(s[i]!=s[i-1]||num==k){
            if(num==k&&i!=1){
                ans[s[i-1]-'a']++;
            }
            num=1;
        }else{
            num++;
        }
    }
    int ANS=0;
    for(int i=0;i<26;i++)
        ANS=max(ANS,ans[i]);
    printf("%d\n",ANS);
return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,j;
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n+1],*pTemp,*pS,key[k+1];
		int sum=0,temp,iCount=0;
		scanf("%s",s);
		for(pS = s;*pS != '\0';pS++)
		{
				if(iCount == 0) key[iCount++] = *pS;
				else if(iCount == k)
				{
					for(pTemp = pS,temp = 1;*pTemp != '\0';pTemp++)
					{
						if(strncmp(key,pTemp,k) == 0)
						{
							temp++;
							pTemp += k-1;
						}
					}
					if(temp > sum) sum = temp;
					iCount = 0;
				}
				else if(*pS == key[0])
				{
					key[iCount++] = *pS;
				}
				else iCount = 0;
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,count[26];
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n+1],*pS,key;
		int sum=0,iCount=0;
		memset(count,0,sizeof(count));
		scanf("%s",s);
		key = s[0];
		for(pS = s;*pS != '\0';pS++)
		{
				if(*pS == key) iCount++;
				else
				{
					iCount = 1;
					key = *pS;
				}
				if(iCount == k)
				{
					count[key - 97]++;
					key = '1';
				}
		}
		for(i=0;i<26;i++)
		{
			if(count[i] > sum) sum = count[i];
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,j,count[26];
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n+1],*pTemp,*pS,key;
		int sum=0,temp,iCount=0;
		memset(count,0,sizeof(count));
		scanf("%s",s);
		for(pS = s;*pS != '\0';pS++)
		{
				if(iCount == 0)
				{
					key = *pS;
					iCount++;
				}
				else if(*pS == key) iCount++;
				else iCount = 0;
				if(iCount == k)
				{
					count[(int)(key) - 97]++;
					iCount = 0;
				}
		}
		for(i=0;i<26;i++)
		{
			if(count[i] > sum) sum = count[i];
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,j;
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n+1],*pTemp,*pS,key[k+1];
		int sum=0,temp,iCount=0;
		scanf("%s",s);
		for(pS = s;*pS != '\0';pS++)
		{
				if(iCount == 0) key[iCount++] = *pS;
				else if(iCount == k)
				{
					for(pTemp = pS,temp = 1,i = 0;*pTemp != '\0';pTemp++)
					{
						if(*pTemp = key[0])
						{
							i++;
						}
						if(i == k)
						{
							temp++;
							i = 0;
						}
					}
					if(temp > sum) sum = temp;
					iCount = 0;
				}
				else if(*pS == key[0])
				{
					key[iCount++] = *pS;
				}
				else iCount = 0;
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,j;
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n],*pTemp,*pS,key[k+1];
		int sum=0,temp,iCount=0;
		scanf("%s",s);
		for(pS = s;*pS != '\0';pS++)
		{
				if(iCount == 0) key[iCount++] = *pS;
				else if(iCount == k)
				{
					for(pTemp = pS,temp = 1;*pTemp != '\0';pTemp++)
					{
						if(strncmp(key,pTemp,k) == 0)
						{
							temp++;
							pTemp += k-1;
						}
					}
					if(temp > sum) sum = temp;
					iCount = 0;
				}
				else if(*pS == key[0])
				{
					key[iCount++] = *pS;
				}
				else iCount = 0;
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,j;
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n+1],*pTemp,*pS,key[k+1];
		int sum=0,temp,iCount=0;
		scanf("%s",s);
		for(pS = s;*pS != '\0';pS++)
		{
				if(iCount == 0) key[iCount++] = *pS;
				else if(iCount == k)
				{
					for(pTemp = pS+1,temp = 1,i = 0;*pTemp != '\0';pTemp++)
					{
						if(strncmp(pTemp,key,k)==0)
						{
							temp++;
							pTemp += k-1;
						}
					}
					if(temp > sum) sum = temp;
					iCount = 0;
				}
				else if(*pS == key[0])
				{
					key[iCount++] = *pS;
				}
				else iCount = 0;
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<cstdio>
#include<cstring>

int main()
{
	int n,i,k,j;
	while((scanf("%d%d",&n,&k))!=EOF)
	{
		char s[n+1],*pTemp,*pS,key[k+1];
		int sum=0,temp,iCount=0;
		scanf("%s",s);
		for(pS = s;*pS != '\0';pS++)
		{
				if(iCount == 0) key[iCount++] = *pS;
				else if(*pS == key[0])
				{
					key[iCount++] = *pS;
				}
				else iCount = 0;
				if(iCount == k)
				{
					for(pTemp = pS+1,temp = 1,i = 0;*pTemp != '\0';pTemp++)
					{
						if(strncmp(pTemp,key,k)==0)
						{
							temp++;
							pTemp += k-1;
						}
					}
					if(temp > sum) sum = temp;
					iCount = 0;
				}
		}
		printf("%d\n",sum);
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		char arr[a];
		char toComp[a];
		memset(arr,0,sizeof(arr));
		memset(toComp,0,sizeof(toComp));
		int m=0;
		int max=0;
		int counting[26]={0};
		scanf("%s",arr);
		for(int i=0;i<a;i++)
		{
			int temp=i;
			for(int j=temp;j<temp+b;j++)
			{
				if(arr[i]!=arr[j]) break;
				else if(j==i+b-1)
				{
					toComp[m++]=arr[i];
					i+=b-1;
//					printf("*");
				}
			}
		}
//		printf("%d ",m);
//		printf("%c",toComp[2]);
		for(int i=0;i<m;i++)
			counting[(toComp[i]-97)]++;
		for(int i=0;i<26;i++)
		{
//			printf("%d ",counting[i]);
			if (counting[i]>max) max=counting[i];
		}
		printf("%d\n",max);
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
void Merge(int* arr,int left,int mid,int right)
{
	int temp[500000];
	int i=left;
	int j=mid+1;
	int m=0;
	while(i<=mid&&j<=right)
	{
		if	(arr[i]<arr[j])   temp[m++]=arr[i++];
		else                  temp[m++]=arr[j++];
	}
	while(i<=mid)   temp[m++]=arr[i++];
	while(j<=right) temp[m++]=arr[j++];
	for(int i=left,m=0;i<=right;i++,m++)
		arr[i]=temp[m];
	memset(temp,0,sizeof(temp));
}
void MergeSort(int* arr,int left,int right)
{
	if(left<right)
	{
		int mid=(left+right)/2;
		MergeSort(arr,left,mid);
		MergeSort(arr,mid+1,right);
		Merge(arr,left,mid,right);
	}
}
int main()
{
	int a;
	while(scanf("%d",&a)!=EOF)
	{
		int arr[a];
		int ans;
		for(int i=0;i<a;i++)
			scanf("%d",&arr[i]);
		MergeSort(arr,0,a-1);
//		for(int i=0;i<a;i++)
//			printf("%d ",arr[i]);
		ans=arr[a/2];
		int lol=0;
		for(int i=0;i<a;i++)
		{
			if(arr[i]>ans) lol+=arr[i]-1-ans;
			else if(arr[i]<ans) lol+=ans-(arr[i]+1);
		}
		printf("%d %d\n",ans,lol);
	}
	return 0;
}


#include<stdio.h>
#include<map>
#include<string>
#include<string.h>
#include<utility>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
#include<math.h>
#include<stack>
#include<set>
#define INF 2147483647
#define n 300000
#define loop(i, a, b) for(int i=a; i<=b; i++)
#define mem(arr) memset(arr, 0, sizeof(arr));
using namespace std;
typedef long long lli;
typedef double llf;
typedef pair<int, int> P;
struct edge{
	int to, weight;
};
void solve();
int main()
{
	int times = 1;
//	cin >> times;
	loop(i, 1, times)
	{
		solve();
		cout << '\n';
	}
	return 0;
}
vector<edge> V[n + 50];
int a, b, c, d, e, f;
int arr[n + 50], arr1[n + 50], arr2[n + 50];
string str, str1, str2;

void solve()
{
	cin >> a >> b;
	cin >> str;
	int cnt[26] = {0};
	int temp = 1;
	for(int i=1; i<a; i++)
	{
		if(temp == b)
		{
			cnt[str[i - 1] - 'a'] ++;
			temp = 1;
		}
		else if(str[i] == str[i - 1])
		{
			temp ++;
		}
		else
		{
			temp = 1;
		}
	}
	if(temp == b)
	{
		cnt[str[str.size() - 1] - 'a'] ++;
	}
	int mx = 0;
	for(int i=0; i<26; i++)
		mx = max(mx, cnt[i]);
	cout << mx << '\n';
}


#include<stdio.h>
#include<string.h>
void swap(int *arr,int a,int b)
{
	int temp = arr[a];
	arr[a] = arr[b];
	arr[b] = temp;
}
void Bubble(int *arr,int size)
{
	for(int i=0;i<size;i++)
	{
		for(int j=1;j<size;j++)
			if(arr[j]<arr[j-1])
				swap(arr,j,j-1);
	}
}
int main()
{
	int a;
	while(scanf("%d",&a)!=EOF)
	{
		int arr[a];
		int ans;
		for(int i=0;i<a;i++)
			scanf("%d",&arr[i]);
		Bubble(arr,a);
//		for(int i=0;i<a;i++)
//			printf("%d ",arr[i]);
		ans=arr[a/2];
		int lol=0;
		for(int i=0;i<a;i++)
		{
			if(arr[i]>ans) lol+=arr[i]-1-ans;
			else if(arr[i]<ans) lol+=ans-(arr[i]+1);
		}
		printf("%d %d\n",ans,lol);
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		char arr[a];
		char toComp[a];
		memset(arr,0,sizeof(arr));
		memset(toComp,0,sizeof(toComp));
		int m=0;
		int max=0;
		int counting[26]={0};
		scanf("%s",arr);
		for(int i=0;i<a;i++)
		{
			for(int j=i;j<i+b;j++)
			{
				if(arr[i]!=arr[j]) break;
				else if(j==i+b-1)
				{
					toComp[m++]=arr[i];
					i+=2;
				}
			}
		}
		for(int i=0;i<m;i++)
			counting[(toComp[i]-97)]++;
		for(int i=0;i<26;i++)
		{
//			printf("%d",counting[i]);
			if (counting[i]>max) max=counting[i];
		}
		printf("%d\n",max);
	}
	return 0;
}


#include<stdio.h>
#include<map>
#include<string>
#include<string.h>
#include<utility>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
#include<math.h>
#include<stack>
#include<set>
#define INF 2147483647
#define n 300000
#define loop(i, a, b) for(int i=a; i<=b; i++)
#define mem(arr) memset(arr, 0, sizeof(arr));
using namespace std;
typedef long long lli;
typedef double llf;
typedef pair<int, int> P;
struct edge{
	int to, weight;
};
void solve();
int main()
{
	int times = 1;
//	cin >> times;
	loop(i, 1, times)
	{
		solve();
		cout << '\n';
	}
	return 0;
}
vector<edge> V[n + 50];
int a, b, c, d, e, f;
int arr[n + 50], arr1[n + 50], arr2[n + 50];
string str, str1, str2;

void solve()
{
	cin >> a >> b;
	cin >> str;
	int cnt[26] = {0};
	int temp = 1;
	for(int i=1; i<a; i++)
	{
		if(temp == b)
		{
			cnt[str[i - 1] - 'a'] ++;
			temp = 1;
		}
		else if(str[i] == str[i - 1])
		{
			temp ++;
			if(i == a - 1 && temp == b) cnt[str[i] - 'a'] ++;
		}
		else
		{
			temp = 1;
		}
	}
	int mx = 0;
	for(int i=0; i<26; i++)
		mx = max(mx, cnt[i]);
	cout << mx << '\n';
}


#include<stdio.h>
#include<string.h>
int main()
{
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		char arr[a];
		char toComp[a];
		memset(arr,0,sizeof(arr));
		memset(toComp,0,sizeof(toComp));
		int m=0;
		int max=0;
		int counting[26]={0};
		scanf("%s",arr);
		for(int i=0;i<a;i++)
		{
			int temp=i;
			for(int j=temp;j<temp+b;j++)
			{
				if(arr[i]!=arr[j]) break;
				else if(j==i+b-1)
				{
					counting[arr[i]-97]++;
					i+=b-1;
//					printf("*");
				}
			}
		}
//		printf("%d ",m);
//		printf("%c",toComp[2]);
		for(int i=0;i<26;i++)
		{
//			printf("%d ",counting[i]);
			if (counting[i]>max) max=counting[i];
		}
		printf("%d\n",max);
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int check(string s)

{
   for(int i=0;i<s.length();i++)
   {
       if(s[0]!=s[i])
       {return 0;}
   }
   return 1;
}

int main()

{

     int n;
     cin>>n;
     int k;
     cin>>k;

     string t;
     cin>>t;

     int level=0;

     int count=0;
     int i=0;

     while(i<n-k+1)
     {
         string x=t.substr(i,k);
         count=0;
         if(check(x))
         {
            count=1;
            for(int j=i+k;j<n-k+1;j+=k)
            {
                string z=t.substr(j,k);
                if(z==x)
                {
                   count++;
                }
            }
            if(count>level)
            {level=count;}
            i+=k;
         }
         i++;
     }
     cout<<level;

}


#include<bits/stdc++.h>

using namespace std;

int check(string s)

{
   for(int i=0;i<s.length();i++)
   {
       if(s[0]!=s[i])
       {return 0;}
   }
   return 1;
}

int main()

{

     int n;
     cin>>n;
     int k;
     cin>>k;

     string t;
     cin>>t;

     int level=0;

     int count=0;

     for(int i=0;i<n-k+1;i++)
     {
         string x=t.substr(i,k);
         count=0;
         if(check(x))
         {
            count=1;
            for(int j=i+k;j<n-k+1;j+=k)
            {
                string z=t.substr(j,k);
                if(z==x)
                {
                   count++;
                }
            }
            if(count>level)
            {level=count;}
         }
     }
     cout<<level;

}


#include<bits/stdc++.h>

using namespace std;

int a[26]={0};

int main()

{

     int n;
     cin>>n;
     int k;
     cin>>k;

     string t;
     cin>>t;

     int count=0;

     for(int i=0;i<n;i++)
     {
         count=1;
         while(t[i]==t[i+1]&&count<k)
         {
             i++;
             count++;
         }
         if(count==k)
         {
             a[t[i]-'a']++;
         }
     }
     int maxi=0;
     for(int i=0;i<26;i++)
     {
        if(a[i]>maxi)
        maxi=a[i];
     }
     cout<<maxi;
}


#include<bits/stdc++.h>

using namespace std;

int check(string s)

{
   for(int i=0;i<s.length();i++)
   {
       if(s[0]!=s[i])
       {return 0;}
   }
   return 1;
}

int main()

{

     int n;
     cin>>n;
     int k;
     cin>>k;

     string t;
     cin>>t;

     int level=0;

     int count=0;
     int i=0;

     while(i<n-k+1)
     {
         string x=t.substr(i,k);
         count=0;
         if(check(x))
         {
            count=1;
            int j=i+k;
            while(j<n-k+1)
            {
               string z=t.substr(j,k);
                if(z==x)
                {
                   count++;
                   j+=k;
                }
                else j++;
            }

            if(count>level)
            {level=count;}
            i+=k;
         }
         else
         i++;
     }
     cout<<level;

}


#include<bits/stdc++.h>

using namespace std;

int check(string s)

{
   for(int i=0;i<s.length();i++)
   {
       if(s[0]!=s[i])
       {return 0;}
   }
   return 1;
}

int main()

{

     int n;
     cin>>n;
     int k;
     cin>>k;

     string t;
     cin>>t;

     int level=0;

     int count=0;
     int i=0;

     while(i<n-k+1)
     {
         string x=t.substr(i,k);
         count=0;
         if(check(x))
         {
            count=1;
            for(int j=i+k;j<n-k+1;j+=k)
            {
                string z=t.substr(j,k);
                if(z==x)
                {
                   count++;
                }
            }
            if(count>level)
            {level=count;}
            i+=k;
         }
         else
         i++;
     }
     cout<<level;

}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=2e5+5;
int n,k,ans;
int s[MAXN],res[30],cnt;
int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		char c=getchar(); while(c<'a'||c>'z') c=getchar();
		s[i]=c-'a'+1;
		if (s[i]==s[i-1]) cnt++;
		else res[s[i-1]]+=cnt/k,cnt=1;
	}
	for (int i=1;i<=26;i++) ans=max(ans,res[i]);
	printf("%d\n",ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=2e5+5;
int n,k,ans;
int s[MAXN],res[30],cnt;
int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		char c=getchar(); while(c<'a'||c>'z') c=getchar();
		s[i]=c-'a'+1;
		if (s[i]==s[i-1]) cnt++;
		else res[s[i-1]]+=cnt-k+1,cnt=1;
	}
	for (int i=1;i<=26;i++) ans=max(ans,res[i]);
	printf("%d\n",ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=2e5+5;
int n,k,ans;
int s[MAXN],res[30],cnt;
int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		char c=getchar(); while(c<'a'||c>'z') c=getchar();
		s[i]=c-'a'+1;
		if (s[i]==s[i-1]) cnt++;
		else res[s[i-1]]+=cnt>=k,cnt=1;
	}
	for (int i=1;i<=26;i++) ans=max(ans,res[i]);
	printf("%d\n",ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=2e5+5;
int n,k,ans;
int s[MAXN],res[30],cnt;
int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		char c=getchar(); while(c<'a'||c>'z') c=getchar();
		s[i]=c-'a'+1;
		if (s[i]==s[i-1]) cnt++;
		else res[s[i-1]]+=max(0,cnt-k+1),cnt=1;
	}
	for (int i=1;i<=26;i++) ans=max(ans,res[i]);
	printf("%d\n",ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=2e5+5;
int n,k,ans;
int s[MAXN],res[30],cnt;
int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		char c=getchar(); while(c<'a'||c>'z') c=getchar();
		s[i]=c-'a'+1;
		if (s[i]==s[i-1]) cnt++;
		else res[s[i-1]]+=cnt/k,cnt=1;
	}
	res[s[n]]+=cnt/k;
	for (int i=1;i<=26;i++) ans=max(ans,res[i]);
	printf("%d\n",ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=2e5+5;
int n,k,ans;
int s[MAXN],res[30],cnt;
int main(){
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++){
		char c=getchar(); while(c<'a'||c>'z') c=getchar();
		s[i]=c-'a'+1;
		if (s[i]==s[i-1]||i==1) cnt++;
		else res[s[i-1]]+=cnt-k+1,cnt=0;
	}
	for (int i=1;i<=26;i++) ans=max(ans,res[i]);
	printf("%d\n",ans);
	return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    int ans = 0;
    for (int i = 0; i < k; ++i)
    {
        int tmp = 0;
        b = a.substr(i, k);
        bool flag = true;
        for (int j = 0; j + 1 < k; ++j)
        {
            if (b[j] != b[j + 1])
            {
                flag = false;
                break;
            }
        }
        if (!flag)
        {
            continue;
        }
        for (int j = i; j + k < n; ++j)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k - 1;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    int ans = 0;
    for (int i = 0; i + k < n; ++i)
    {
        int tmp = 0;
        b = a.substr(i, k);
        bool flag = true;
        for (int j = 0; j + 1 < k; ++j)
        {
            if (b[j] != b[j + 1])
            {
                flag = false;
                break;
            }
        }
        if (!flag)
        {
            continue;
        }
        for (int j = i; j + k < n; ++j)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k - 1;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    int ans = 0;
    for (int i = 0; i < k; ++i)
    {
        int tmp = 0;
        b = a.substr(i, k);
        bool flag = true;
        for (int j = 0; j + 1 < k; ++j)
        {
            if (b[j] != b[j + 1])
            {
                flag = false;
                break;
            }
        }
        if (!flag)
        {
            continue;
        }
        for (int j = i; j + k < n; j += k)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    int ans = 0;
    for (int i = 0; i < 26; ++i)
    {
        int tmp = 0;
        b = string(k, 'a' + i);
        for (int j = 0; j + k < n + 1; ++j)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k - 1;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int time[26];
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    for (int i = 0; i < n; ++i)
    {
        ++time[a[i] - 'a'];
    }
    int ans = 0;
    for (int i = 0; i < 26; ++i)
    {
        if (time[i] < k)
        {
            continue;
        }
        int tmp = 0;
        b = string(k, 'a' + i);
        for (int j = 0; j + k < n + 1; ++j)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k - 1;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    int ans = 0;
    for (int i = 0; i < 26; ++i)
    {
        int tmp = 0;
        b = string(k, 'a' + i);
        for (int j = 0; j + k < n; ++j)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k - 1;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n, k;
    string a, b;
    cin >> n >> k >> a;
    int ans = 0;
    for (int i = 0; i < 26; ++i)
    {
        int tmp = 0;
        b = string(k, 'a' + i);
        for (int j = i; j + k < n; ++j)
        {
            if (b == a.substr(j, k))
            {
                ++tmp;
                j += k - 1;
            }
        }
        ans = max(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, k, length, curr, mx(0);
	string str;

	cin >> n >> k >> str;

	for (char i = 'a' ; i <= 'z' ; ++i) {
		curr = 0;
		length = 0;
		for (int j = 0 ; j < n ; j++) {
			if (str[j] == i) {
				curr++;
				if (curr >= k) {
					length++;
					curr = 0;
				}
			}
			else {
				curr = 0;
			}
		}
		mx = max(mx, length);
	}

	cout << mx << "\n";
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, k;
	string str;
	unordered_map<char, int> map;

	cin >> n >> k >> str;

	if (k == 1) {
		cout << "1\n";
		return 0;
	}

	for (int i = 0 ; i < n ; ) {
		set<int> st;
		if (i + k >= n) {
			break;
		}

		for (int j = i ; j < i + k ; ++j) {
			st.insert(str[j]);
		}

		if (st.size() == 1) {
			i += k;
			map[*st.begin()]++;
		}
		else {
			i++;
		}
	}
	int mx(0);

	for (pair<char, int> pa : map) {
		mx = max(pa.second, mx);
	}

	cout << mx << "\n";

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, k;
	string str;
	unordered_map<char, int> map;

	cin >> n >> k >> str;

	for (int i = 0 ; i < n ; ) {
		set<int> st;

		if (i + k > n) {
			break;
		}

		for (int j = i ; j < i + k ; ++j) {
			st.insert(str[j]);
		}

		if (st.size() == 1) {
			i += k;
			map[*st.begin()]++;
		}
		else {
			i++;
		}
	}
	int mx(0);

	for (pair<char, int> pa : map) {
		mx = max(pa.second, mx);
	}

	cout << mx << "\n";

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, k;
	string str;
	unordered_map<char, int> map;

	cin >> n >> k >> str;

	if (k == 1) {
		cout << "1\n";
		continue;
	}

	for (int i = 0 ; i < n ; ) {
		set<int> st;
		if (i + k >= n) {
			break;
		}

		for (int j = i ; j < i + k ; ++j) {
			st.insert(str[j]);
		}

		if (st.size() == 1) {
			i += k;
			map[*st.begin()]++;
		}
		else {
			i++;
		}
	}
	int mx(0);

	for (pair<char, int> pa : map) {
		mx = max(pa.second, mx);
	}

	cout << mx << "\n";

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, k, length, curr, mx(0);
	string str;

	cin >> n >> k >> str;

	for (char i = 'a' ; i <= 'z' ; ++i) {
		curr = 0;
		length = 0;
		for (int j = 0 ; j < n ; j++) {
			if (str[j] == i) {
				curr++;
				if (curr >= k) {
					length++;
					curr = 0;
				}
			}
			else {
				curr = 0;
			}
		}
		mx = max(mx, length);
	}

	cout << mx << "\n";
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n, k;
	string str;
	unordered_map<char, int> map;

	cin >> n >> k >> str;

	for (int i = 0 ; i < n ; ) {
		set<int> st;
		if (i + k >= n) {
			break;
		}

		for (int j = i ; j < i + k ; ++j) {
			st.insert(str[j]);
		}

		if (st.size() == 1) {
			i += k;
			map[*st.begin()]++;
		}
		else {
			i++;
		}
	}
	int mx(0);

	for (pair<char, int> pa : map) {
		mx = max(pa.second, mx);
	}

	cout << mx << "\n";

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k; cin>>n>>k;
    string s; cin>>s;

    map<char, int> m;
    string temp="";
    for(int i=0; i<s.length(); i++){

        if(temp.length()== k){
            m[temp[0]]++;
            temp= "";
        }
        if(!temp.empty() && temp[0]!= s[i]) temp="";
        temp+= s[i];

    }
        if(temp.length()== k){
            m[temp[0]]++;
            temp= "";
        }
    int result=0;
    for(auto it= m.begin(); it!= m.end(); it++) if(it->second> result) result = it->second;
    cout<<result<<endl;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k; cin>>n>>k;
    string s; cin>>s;

    map<char, int> m;
    string temp="";
    for(int i=0; i<s.length(); i++){

        if(temp.length()== k){
            m[temp[0]]++;
            temp= "";
        }
        if(!temp.empty() && temp[0]!= s[i]) temp="";
        temp+= s[i];

    }

    int result=0;
    for(auto it= m.begin(); it!= m.end(); it++) if(it->second> result) result = it->second;
    cout<<result<<endl;
}


#include <bits/stdc++.h>
using namespace std;

bool check(string s, int i, int k){
    if(i< k-1) return false;
    int ii= i-k+1;
    for(; k; k--, ii++) if(s[ii]!= s[i]) return false;
    return true;

}
int main(){
    int n, k; cin>>n>>k;
    string s; cin>>s;
    if(n==1){
        if( k==1) cout<<1<<endl;
        return 0;
    }

    int t=0;
    map<char, int> r;
    for(int i=0; i<n; ){
            if(check(s, i, k)){ r[s[i]]++; i+=k;}
            else i++;
    }
    int result= 0;
    for(auto it= r.begin(); it!= r.end(); it++) if(it->second > result) result= it->second;
    cout<<result;
}


#include <bits/stdc++.h>
using namespace std;

inline bool check(string s, int i, int k){
    if(i< k-1) return false;
    int ii= i-k+1;
    for(; k; k--, ii++) if(s[ii]!= s[i]) return false;
    return true;

}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k; cin>>n>>k;
    string s; cin>>s;

    map<char, int> r;

    for(int i=0; i<n; ){
            if(check(s, i, k)){ r[s[i]]++; i+=k;}
            else i++;
    }
    int result= 0;
    for(auto it= r.begin(); it!= r.end(); it++) if(it->second > result) result= it->second;
    cout<<result;
}


#include <bits/stdc++.h>
using namespace std;

bool check(string s, int i, int k){
    if(i< k-1) return false;
    int ii= i-k+1;
    for(; k; k--, ii++) if(s[ii]!= s[i]) return false;
    return true;

}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k; cin>>n>>k;
    string s; cin>>s;

    map<char, int> r;
    for(int i=0; i<n; ){
            if(check(s, i, k)){ r[s[i]]++; i+=k;}
            else i++;
    }
    int result= 0;
    for(auto it= r.begin(); it!= r.end(); it++) if(it->second > result) result= it->second;
    cout<<result;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            A[s[i]]++;
            i += k;
        }else{
            i ++;
        }

    }
    int max = -1;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    vector<int>a;
    a.resize(1000000000);
    int mix = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            a[s[i] - '0']++;
            if(s[i] - '0' > mix){
                mix = s[i] - '0';
            }
            i += k;
        }else{
            i ++;
        }

    }
    int max = a[0];
    a.resize(mix + 1);
    for(int i = 0; i < a.size();i ++){
        if(a[i] > max){
            max = a[i];
        }
    }

   cout << max;
   // for(int i = 0;i < a.size();i ++){
     //   cout << a[i] << " ";
    //}
    return 1337;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            A[s[i]]++;
            i += k;
        }else{
            i ++;
        }

    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 1;
    for(int i = 1;i < s.size();i ++){
        if(s[i] == s[i-1]){
            count ++;
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
        }else{
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
            count = 1;
        }
    }
    if(s.size() == 1 && k ==1){
        A[s[0]]++;
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 1;
    for(int i = 0; i < s.size() - 1;i ++ ){
        if(s[i] == s[i+1]){
            count ++;
            if(count == k){
                A[s[i]]++;
                count = 1;
                i ++;
            }
        }else{
            count= 1;
        }
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 1;
    for(int i = 1;i < s.size();i ++){
        if(s[i] == s[i-1]){

            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
            count ++;
        }else{
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
            count = 1;
        }
    }
    if(s.size() == 1 && k ==1){
        A[s[0]]++;
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 1;
    for(int i = 1;i < s.size();i ++){
        if(s[i] == s[i-1]){
            count ++;
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
        }else{
            count = 1;
        }
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    vector<int>a;
    a.resize(1000000000);
    int mix = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            a[s[i] - '0']++;
            if(s[i] - '0' > mix){
                mix = s[i] - '0';
            }
            i += k;
        }else{
            i ++;
        }

    }
    int max = a[0];
    a.resize(mix + 1);
    for(int i = 0; i < a.size();i ++){
        if(a[i] > max){
            max = a[i];
        }
    }

   cout << max;
   // for(int i = 0;i < a.size();i ++){
     //   cout << a[i] << " ";
    //}
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 0;
    if(k == 1){
        for(int i = 0;i < s.size();i ++){
            A[s[i]] ++;
        }
    }else{
        int j = 1;
        while(j < s.size()){
            if(s[j] == s[j-1]){
                count ++;
            }else{
                count = 0;
            }
            if(count == k - 1){
                A[s[j]] ++;
                j ++;
                count = 0;
            }
            j ++;
        }
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <fstream>
#include <vector>

using namespace std;
ifstream cin("input.txt");
ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    vector<int>a;
    a.resize(1000);
    int mix = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            a[s[i] - '0']++;
            if(s[i] - '0' > mix){
                mix = s[i] - '0';
            }
            i += k;
        }else{
            i ++;
        }

    }
    int max = a[0];
    a.resize(mix + 1);
    for(int i = 0; i < a.size();i ++){
        if(a[i] > max){
            max = a[i];
        }
    }

   cout << max;
   // for(int i = 0;i < a.size();i ++){
     //   cout << a[i] << " ";
    //}
}


#include <iostream>
#include <vector>

using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {/*
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    vector<int>a;
    a.resize(1000000000);
    int mix = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            a[s[i] - '0']++;
            if(s[i] - '0' > mix){
                mix = s[i] - '0';
            }
            i += k;
        }else{
            i ++;
        }

    }
    int max = a[0];
    a.resize(mix + 1);
    for(int i = 0; i < a.size();i ++){
        if(a[i] > max){
            max = a[i];
        }
    }

   cout << max;
   // for(int i = 0;i < a.size();i ++){
     //   cout << a[i] << " ";
    //}*/
    return 1337;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 1;
    for(int i = 1;i < s.size();i ++){
        if(s[i] == s[i-1]){
            count ++;
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
        }else{
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
            count = 1;
        }
    }
    if(s[0] ==1 && k ==1){
        A[s[0]]++;
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 1;
    for(int i = 1;i < s.size();i ++){
        if(s[i] == s[i-1]){
            count ++;
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
        }else{
            if(count == k){
                A[s[i]]++;
                i++;
                count = 1;
            }
            count = 1;
        }
    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <map>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
int main() {
    map<char,int>A;
    int n,k;
    cin >> n >> k;
    cin >> s;
    int count = 0;
    for(int i = 0;i < s.size() -1;i ++){
        if(count == k - 1){
            A[s[i]]++;
            count = 0;
        }
        if(s[i] != s[i+1] ){
            count = 0;
        } else{
            count ++;
        }

    }
    int max = 0;
    pair <int,int> tp;
    for(auto i = A.begin();i != A.end();i ++){
        tp=*i;
        if(tp.second > max){
            max = tp.second;
        }
    }
    cout << max;

    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    vector<int>a;
    a.resize(1000);
    int mix = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            a[s[i] - '0']++;
            if(s[i] - '0' > mix){
                mix = s[i] - '0';
            }
            i += k;
        }else{
            i ++;
        }

    }
    int max = 0;
    a.resize(mix + 1);
    for(int i = 0; i < a.size();i ++){
        if(a[i] > max){
            max = i;
        }
    }

    cout << max;
}


#include <iostream>
#include <vector>

using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
string s;
bool check(int size,int id){
    for(int i = id;i < id + size;i ++){
        if(s[i] != s[id])
            return false;
    }
    return true;
}
int main() {
    int n,k;
    cin >> n >> k;
    cin >> s;
    int i = 0;
    vector<int>a;
    a.resize(1000);
    int mix = 0;
    while(i <= s.size() - k){
        if(check(k,i) == true){
            a[s[i] - '0']++;
            if(s[i] - '0' > mix){
                mix = s[i] - '0';
            }
            i += k;
        }else{
            i ++;
        }

    }
    int max = a[0];
    a.resize(mix + 1);
    for(int i = 0; i < a.size();i ++){
        if(a[i] > max){
            max = a[i];
        }
    }

   cout << max;
   // for(int i = 0;i < a.size();i ++){
     //   cout << a[i] << " ";
    //}
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,k;
    int cnt=1;
    string s;
    cin>>n>>k;
    cin>>s;
    int arr[196];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<s.size();i++){
        if(i>0){
            if(s[i]==s[i-1]){
                    cnt++;
                    if((i+1)==s.size()){
                        arr[s[i]]+=(cnt/k);
                        break;
                    }
            }

            if(s[i]!=s[i-1]){
                    arr[s[i]]=arr[s[i]]+(cnt/k);
                    cnt=1;
            }

        }
    }
    int max=0;
    for(int i=0;i<196;i++){
        if(max<arr[i]){
            max=arr[i];
        }
    }
    cout<<max;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,k;
    int cnt=1;
    string s;
    cin>>n>>k;
    cin>>s;
    int arr[196];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<s.size();i++){
        if(i==0){
            arr[s[i]]+=(cnt/k);
            if(cnt==k){
                     if(s[i+1]==s[i]){
                        cnt=0;
                    }
                    else if(s[i+1]!=s[i]){
                        cnt=1;
                    }

            }
        }
        else{
            if(s[i]==s[i-1]){
                cnt++;
                arr[s[i]]+=(cnt/k);
                if(cnt==k){
                    if(s[i+1]==s[i]){
                        cnt=0;
                    }
                    else if(s[i+1]!=s[i]){
                        cnt=1;
                    }
                }
            }
            else if(s[i]!=s[i-1]){
                cnt=1;
                arr[s[i]]+=(cnt/k);
            }
        }
    }
    int max=0;
    for(int i=0;i<196;i++){
        if(max<arr[i]){
            max=arr[i];
        }
    }
    cout<<max;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,k;
    int cnt=1;
    string s;
    cin>>n>>k;
    cin>>s;
    int arr[196];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<s.size();i++){
        if(i==0){
            arr[s[i]]+=(cnt/k);
        }
        else{
            if(s[i]==s[i-1]){
                cnt++;
                arr[s[i]]=0;
                arr[s[i]]+=(cnt/k);
            }
            else if(s[i]!=s[i-1]){
                cnt=1;
                arr[s[i]]+=(cnt/k);
            }
        }
    }
    int max=0;
    for(int i=0;i<196;i++){
        if(max<arr[i]){
            max=arr[i];
        }
    }
    cout<<max;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,k;
    int cnt=1;
    string s;
    cin>>n>>k;
    cin>>s;
    int arr[196];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<s.size();i++){
        if(i==0){
            arr[s[i]]+=(cnt/k);
        }
        else{
            if(s[i]==s[i-1]){
                cnt++;
                arr[s[i]]+=(cnt/k);
                if(cnt==k){
                    if(s[i+1]==s[i]){
                        cnt=0;
                    }
                    else if(s[i+1]!=s[i]){
                        cnt=1;
                    }
                }
            }
            else if(s[i]!=s[i-1]){
                cnt=1;
                arr[s[i]]+=(cnt/k);
            }
        }
    }
    int max=0;
    for(int i=0;i<196;i++){
        if(max<arr[i]){
            max=arr[i];
        }
    }
    cout<<max;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,k;
    int cnt=1;
    string s;
    cin>>n>>k;
    cin>>s;
    int arr[196];
    memset(arr,0,sizeof(arr));
    for(int i=0;i<s.size();i++){
        if(i>0){
            if(s[i]==s[i-1]){
                    cnt++;
            }
            else if(s[i]!=s[i-1]){
                cnt=1;
            }
            if(cnt==k){
                arr[s[i]]++;
            }

        }
    }
    int max=0;
    for(int i=0;i<196;i++){
        if(max<arr[i]){
            max=arr[i];
        }
    }
    cout<<max;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,k,c=0,temp=0;
    set<char>s;
    pair<set<char>::iterator,bool>p;
    map<char,int>vec;
    map<char,int>::iterator it;
    cin>>n>>k;
    char re[n+1];
    for(int i=0;i<n;i++){
        cin>>re[i];
        p=s.insert(re[i]);
        if(p.second==1){
            vec.insert(make_pair(re[i],0));
        }
    }
    if(s.size()==1){
        cout<<n<<endl;
        return 0;
    }

    for(int i=0;i<n;i++){
            if(re[i]==re[i+1]){
                c++;
            }
            else c=0;
            if(c==k-1){
            vec[re[i]]+=1;
              c=0;
              i++;
            }
    }
   for(it=vec.begin();it!=vec.end();it++){
  // cout<<it->first<<" "<<it->second<<endl;
   if(it->second>temp){
    temp=it->second;
   }
  }
   cout<<temp<<endl;
}