Inexact string#486

Inexact string

1 second
64 megabytes
Very hard

We say that strings and have differences if the lengths of these strings are the same, and the characters at the same positions match except for positions. For example, the strings and have differences.

Given a string of length and a number , find two substrings of equal length that start at different positions and have at most differences. The string consists of uppercase Latin letters.

Input

The first line contains the integer , and the second line contains the string .

Output

Output one integer: the length of the longest such substring, or if there is no solution.

0 \le k \le N \le 1000

Examples

Example 1

Loading
Loading