Problem: You are given a string s of length n. Each character is either one of the first k lowercase Latin letters or a question mark.

You are asked to replace every question mark with one of the first k lowercase Latin letters in such a way that the following value is maximized.

Let f_i be the maximum length substring of string s, which consists entirely of the i-th Latin letter. A substring of a string is a contiguous subsequence of that string. If the i-th letter doesn't appear in a string, then f_i is equal to 0.

The value of a string s is the minimum value among f_i for all i from 1 to k.

What is the maximum value the string can have?

Input

The first line contains two integers n and k (1 ≤ n ≤ 2 ⋅ 10^5; 1 ≤ k ≤ 17) — the length of the string and the number of first Latin letters used.

The second line contains a string s, consisting of n characters. Each character is either one of the first k lowercase Latin letters or a question mark.

Output

Print a single integer — the maximum value of the string after every question mark is replaced with one of the first k lowercase Latin letters.

Examples

Input


10 2
a??ab????b


Output


4


Input


9 4
?????????


Output


2


Input


2 3
??


Output


0


Input


15 3
??b?babbc??b?aa


Output


3


Input


4 4
cabd


Output


1

Note

In the first example the question marks can be replaced in the following way: "aaaababbbb". f_1 = 4, f_2 = 4, thus the answer is 4. Replacing it like this is also possible: "aaaabbbbbb". That way f_1 = 4, f_2 = 6, however, the minimum of them is still 4.

In the second example one of the possible strings is "aabbccdda".

In the third example at least one letter won't appear in the string, thus, the minimum of values f_i is always 0.

Solution (in CPP):

Solution:
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ud unsigned int
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x3f
#define MAX_INF_VAL 0x3f3f3f3f
#define MAX_INF_VAL_LL 0x3f3f3f3f3f3f3f3f
//#define pi 3.141592653589
#define eps 1e-9
#define F(x) ((x)/3+((x)%3==1?0:tb))
#define G(x) ((x)<tb?(x)*3+1:((x)-tb)*3+2)
//#define p 2173412051LL
//#define sz 2

using namespace std;

template< typename T > void read( T &x ) {
	x = 0;
	char ch = getchar();
	ll f = 1;
	while( !isdigit( ch ) ) {
		if( ch == '-' )
		f *= -1;
		ch = getchar();
	}
	while( isdigit( ch ) ) {
		x = x * 10 + ch - 48;
		ch = getchar();
	}
	x *= f;
}

struct custom_hash {
    static uint64_t splitmix64( uint64_t x ) {
        x += 0x9e3779b97f4a7c15;
        x = ( x ^ ( x >> 30 ) ) * 0xbf58476d1ce4e5b9;
        x = ( x ^ ( x >> 27 ) ) * 0x94d049bb133111eb;
        return x ^ ( x >> 31 );
    }

    size_t operator() ( uint64_t x ) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64( x + FIXED_RANDOM );
    }
};

int n, m;
char s[ 200010 ];
int sum[ 400010 ][ 18 ];
int nxt[ 200010 ][ 17 ];
int f[ 1 << 17 ];

int get( int, int, int );
bool check( int );

int main() {
	ios::sync_with_stdio( false );
	cin.tie( 0 ), cout.tie( 0 );
	cin >> n >> m;
	cin >> s + 1;
	for( int i = 1; i <= n; ++i ) {
		if( s[ i ] == '?' )
			s[ i ] = m;
		else
			s[ i ] -= 'a';
		memcpy( sum[ i ], sum[ i - 1 ], sizeof( sum[ i - 1 ] ) );
		++sum[ i ][ s[ i ] ];
	}
	int l = 0, r = n;
	while( l <= r ) {
		int mid = l + r >> 1;
		if( !check( mid ) )
			r = mid - 1;
		else
			l = mid + 1;
	}
	cout << l - 1;
	return 0;
}

int get( int c, int l, int r ) {
	return sum[ r ][ c ] - sum[ l - 1 ][ c ];
}

bool check( int x ) {
	for( int i = 0; i < m; ++i )
		nxt[ n + 2 ][ i ] = n + 1;
	for( int i = n + 1; i; --i )
		for( int j = 0; j < m; ++j )
			if( get( j, i, i + x - 1 ) + get( m, i, i + x - 1 ) == x )
				nxt[ i ][ j ] = i + x - 1;
			else
				nxt[ i ][ j ] = nxt[ i + 1 ][ j ];
	fill( f, f + ( 1 << m ), n + 1 );
	f[ 0 ] = 0;
	for( int i = 0; i < ( 1 << m ); ++i ) {
		for( int j = 0, msk = 1; j < m; ++j, msk <<= 1 ) {
			if( i & msk )
				continue;
			int nmsk = i | msk;
			f[ nmsk ] = min( f[ nmsk ], nxt[ f[ i ] + 1 ][ j ] );
		}
	}
	return f[ ( 1 << m ) - 1 ] <= n;
}