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,unroll-loops,no-stack-protector")
#include <bits/stdc++.h>
using namespace std;

#define df(b, e) ((b) > (e))
#define fore(i, b, e) for (auto i = (b) - df(b, e); i != e - df(b, e); i += 1 - 2 * df(b, e))
#define ceil(a, b) ((a + b - 1) / b)
#define round(a, b) ((2 * a + b) / (2 * b))
#define sz(x) (int)(x.size())
#define all(x) begin(x), end(x)
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mp make_pair

using lli = long long;
using ld = long double;
using ii = pair<int, int>;
using vi = vector<int>;

#ifdef LOCAL
  #include "debug.h"
  const int N = 10;
#else
  #define debug(...)
  const int N = 2e5 + 5;
#endif
const int inf = 1e9 + 7;


template <class T>
bool umin(T &a, T b) {
  a = min(a, b);
  return a == b;
}

int n, k;
string s;

bool can (int len) {
  debug(len);
  vector<int> cnt(k + 1, 0);
  vector<vector<int>> pos(k + 1, vector<int>());
  if (len * k > n) {
    return false;
  }

  fore (i, 0, len) {
    char c = s[i];
    if (c != '?') {
      cnt[c - 'a' + 1] ++;
    }
  }

  fore (i, len, n + 1) {
    int l = i - len;
    char add = s[i];
    char rem = s[l];
    debug(i, l, add, rem);

    {
      int sum = 0;
      fore (j, 1, k + 1) {
        if (cnt[j] > 0) {
          sum ++;
        }
      }

      if (sum == 0) {
        fore (j, 1, k + 1) {
          pos[j].push_back(l);
        }
      }

      if (sum == 1) {
        fore (j, 1, k + 1) {
          if (cnt[j] > 0) {
            pos[j].push_back(l);
          }
        }
      }
    }

    if (rem != '?') {
      cnt[rem - 'a' + 1] --;
    }

    if (add != '?') {
      cnt[add - 'a' + 1] ++;
    }
  }  

  debug(pos);
  vector<int> dp(1 << k, inf);
  dp[0] = -inf;
  fore (mask, 0, 1 << k) {
    fore (i, 0, k) {
      if (!(mask >> i & 1)) {
        auto kth = lower_bound(all(pos[i + 1]), dp[mask] + len) - begin(pos[i + 1]);
        if (kth < sz(pos[i + 1])) {
          umin(dp[mask | (1 << i)], pos[i + 1][kth]);
        }
      }
    }
  }
  debug("");
  debug("");
  return dp[(1 << k) - 1] != inf;
}

void run_case () {
  cin >> n >> k;
  cin >> s;
  s += "?";
  int lo = 0, hi = n + 1;
  while (lo < hi - 1) {
    int mid = (lo + hi) >> 1;
    if (can(mid)) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  cout << lo << '\n';
}

int main() {
  cin.tie(0) -> sync_with_stdio(0), cout.tie(0);
  int t = 1;
  // cin >> t;

  while (t--) {
    run_case();
  }
  return 0;
}