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 JAVA):

Solution:
import java.util.*;
import java.io.*;

public class Div730 {
    static int n, k, size;
    static int[][] dp;
    static int[][] cnt;
    static int[] dp2;

    static int dp2(int msk) {

        if (msk == 0)
            return n;

        if (dp2[msk] != -2)
            return dp2[msk];
        int ans = -1;
        for (int take = 0; take < k; take++) {
            if ((msk & 1 << take) != 0) {
                int id = dp2(msk ^ (1 << take));
                int here = dp(take, id - 1);
                ans = Math.max(ans, here);
            }
        }
        return dp2[msk] = ans;
    }

    static int dp(int c, int i) {
        if (i - size < -1)
            return -1;
        if (dp[c][i] != -2)
            return dp[c][i];

        int cn = cnt[c][i] + cnt[k][i];
        if (i - size >= 0)
            cn -= (cnt[c][i - size] + cnt[k][i - size]);
        int ans = -1;
        if (cn == size) {
            ans = i - size + 1;
        } else ans = Math.max(ans, dp(c, i - 1));
        return dp[c][i] = ans;
    }

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        n = sc.nextInt();
        k = sc.nextInt();

        char[] s = sc.next().toCharArray();

        cnt = new int[k + 1][n];
        for (int i = 0; i < n; i++) {
            if (s[i] != '?')
                cnt[s[i] - 'a'][i]++;
            else cnt[k][i]++;
            if (i > 0)
                for (int l = 0; l <= k; l++)
                    cnt[l][i] += cnt[l][i - 1];
        }

        int low = 0;
        int hi = n;
        int ans = 0;
        while (low <= hi) {
            int mid = low + hi >> 1;
            size = mid;
            dp2 = new int[1 << k];
            for (int i = 0; i < dp2.length; i++)
                dp2[i] = -2;
            dp = new int[k][n];
            for (int l = 0; l < k; l++)
                for (int i = 0; i < n; i++)
                    dp[l][i] = -2;

            if (dp2((1 << k) - 1) >= 0) {
                ans = mid;
                low = mid + 1;
            } else hi = mid - 1;
        }
        pw.println(ans);

        pw.flush();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int[] nextIntArr(int n) throws IOException {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }
    }

}