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 _111 {
    static int MAX = (int) 1e7;
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;
        while (t-- > 0) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            String s = sc.next();
            int l = 0; int r = n / k + 2;
            while (l < r) {
                int len = (l + r) / 2;
                // starting from the suffix at i, how far do I have to go to create a run of length len
                int [][] end = new int[k][n + 1];
                for (int [] arr: end) Arrays.fill(arr, MAX);
                for (int c = 0; c < k; c++) {
                    int run = 0;
                    for (int i = n - 1; i >= 0; i--) {
                        if (s.charAt(i) == 'a' + c || s.charAt(i) == '?') ++run; else run = 0;
                        end[c][i] = end[c][i + 1];
                        if (run >= len) end[c][i] = i + len - 1;
                    }
                }
                // length of the minimum prefix such that we can fit runs of all the bits set in mask
                int [] dp = new int[1 << k];
                Arrays.fill(dp, MAX);
                dp[0] = -1;
                for (int i = 1; i < (1 << k); i++) {
                    for (int j = 0; j < k; j++) {
                        if (((i >> j) & 1) == 1 && dp[i ^ (1 << j)] < MAX) {
                            int previous = dp[i ^ (1 << j)];
                            dp[i] = Math.min(dp[i], end[j][previous + 1]);
                        }
                    }
                }
                if (dp[(1 << k) - 1] < MAX) {
                    l = len + 1;
                } else {
                    r = len;
                }
            }
            out.println(l - 1);
        }
        out.close();
    }




    static void sort(int[] a) {
        ArrayList<Integer> q = new ArrayList<>();
        for (int i : a) q.add(i);
        Collections.sort(q);
        for (int i = 0; i < a.length; i++) a[i] = q.get(i);
    }

    static void sort(long[] a) {
        ArrayList<Long> q = new ArrayList<>();
        for (long i : a) q.add(i);
        Collections.sort(q);
        for (int i = 0; i < a.length; i++) a[i] = q.get(i);
    }


    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}