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:
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

vector<ll> v[20];
ll dp[200200][20];
ll dpreal[200200];
ll a[200200];
ll n,k,cap;

ll phah(ll xd){
  ll s=0;
  while(xd){
    if(xd%2==1)++s;
    xd/=2;
    }
  return s;
  }

void makedp(ll sz){
  for(ll j=1;j<=k;++j){
    ll br=0,id=1e9;
    for(ll i=n;i>=0;--i){
      if(br>=sz){
        id=i+sz;
        }
      //if(j==1)cout<<i<<" "<<id<<endl;
      if(a[i]!=a[i+1]){
        if(a[i]==0 && a[i+1]==j);
        else if(a[i]==j && a[i+1]==0);
        else br=0;
        }
      //if(j==1)cout<<i<<" "<<id<<endl;
      if(a[i]==0 || a[i]==j)++br;
      dp[i][j]=id;
      }
    }
  }

bool isok(ll sz){
  makedp(sz);

  //cout<<sz<<endl;
  //if(sz==1){
    //for(ll i=0;i<=n;++i){cout<<i<<" - ";for(ll j=1;j<=k;++j){cout<<dp[i][j]<<" ";}cout<<endl;}cout<<endl;
    //for(ll i=0;i<=n;++i)cout<<dp[i][5]<<endl;cout<<endl;
    //for(ll i=0;i<=n;++i)cout<<dp[i][7]<<endl;cout<<endl;
    //for(ll i=0;i<=n;++i)cout<<dp[i][15]<<endl;cout<<endl;
  //  }

  for(ll i=1;i<=cap;++i)dpreal[i]=1e9;
  dpreal[0]=0;

  for(ll i=0;i<k;++i){
    for(ll j : v[i]){
      if(dpreal[j]==1e9)continue;
      for(ll h=0;h<k;++h){
        if(j&(1<<h) || dp[dpreal[j]][h+1]==1e9)continue;
        //cout<<j<<" "<<dpreal[j]<<" "<<h+1<<" "<<dp[dpreal[j]][h+1]<<endl;
        dpreal[j+(1<<h)]=min(dpreal[j+(1<<h)],dp[dpreal[j]][h+1]);
        }
      }
    }

  //cout<<endl<<endl;
  if(dpreal[cap-1]!=1e9)return 1;
  else return 0;
  }

int main(){

cin>>n>>k;cap=1<<k;
for(ll i=1;i<=n;++i){
  char c;
  cin>>c;
  if(c=='?')a[i]=0;
  else a[i]=c-'a'+1;
  }
a[0]=-1;
a[n+1]=-1;

for(ll i=0;i<cap;++i){
  v[phah(i)].push_back(i);
  }

ll l=1,mid,r=n,res=0;
while(l<=r){
  mid=(l+r)/2;

  if(isok(mid)){
    res=mid;
    l=mid+1;
    }
  else {
    r=mid-1;
    }
  }

cout<<res<<endl;

return 0;
}
/*
3 3
a?a

22 15
imdhjcn?dbn?abnhkmnfal

h??
abcd?f?hijklmn?
    e g       o

*/