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,no-stack-protector,unroll-loops,fast-math")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <map>
#include <set>
#include <tuple>
#include <cmath>
#include <cstdio>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <unordered_set>
#include <cstring>
#include <random>
#include <bitset>

using namespace std;

//#define int long long
#define forn(i, n) for(int i = 0; i < n; ++i)
#define all(a) (a).begin(), (a).end()
#define pb push_back
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int> >;
using vvvi = vector<vector<vector<int> > >;
using vvvvi = vector<vector<vector<vector<int> > > >;

struct Timer{
    clock_t start;
    Timer(){
        start = clock();
    };
    ~Timer(){
        clock_t finish = clock();
        cout << fixed << setprecision(15) << (ld)(finish-start)/CLOCKS_PER_SEC << endl;
    };
};

const int INF = 1e9+7;

void solve(istream& cin, ostream& cout){
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int l = 0, r = n+1;
    while(l+1 != r){
        int d = l+(r-l)/2;
        vvi next(k, vi(n+1, -1));
        forn(letter, k){
            int cur = -1;
            for (int i = n-1; i >= 0; --i){
                if (s[i] == '?' || s[i]-'a' == letter){
                    if (cur == -1) cur = 1;
                    else cur++;
                    if (d <= cur) next[letter][i] = i+d;
                    else next[letter][i] = next[letter][i+1];
                }else{
                    cur = -1;
                    next[letter][i] = next[letter][i+1];
                }
            }
        }
        vi dp(1<<k, INF);
        dp[0] = 0;
        for (int mask = 0; mask < (1<<k); ++mask){
            if (dp[mask] == INF) continue;
            for (int i = 0; i < k; ++i) if ((mask&(1<<i)) == 0){
                    int nmask = mask|(1<<i);
                    if (next[i][dp[mask]] == -1) continue;
                    dp[nmask] = min(dp[nmask], next[i][dp[mask]]);
                }
        }
        if (dp[(1<<k)-1] != INF) l = d;
        else r = d;
    }
    cout << l << '\n';
}

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int tt = 1;
//    cin >> tt;
    while (tt--){
        solve(cin, cout);
    }
    return 0;
}

//4
//5
//1 2 4
//2 3 1
//3 4 2
//2 4 4
//1 3 2