{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eGiven a string S and two integers L and M, we consider a substring of S as “recoverable” if and only if\u003cbr\u003e\u0026nbsp;\u0026nbsp;(i) It is of length M*L;\u003cbr\u003e\u0026nbsp;\u0026nbsp;(ii) It can be constructed by concatenating M “diversified” substrings of S, where each of these substrings has length L; two strings are considered as “diversified” if they don’t have the same character for every position.\u003cbr\u003e\u003cbr\u003eTwo substrings of S are considered as “different” if they are cut from different part of S. For example, string \"aa\" has 3 different substrings \"aa\", \"a\" and \"a\".\u003cbr\u003e\u003cbr\u003eYour task is to calculate the number of different “recoverable” substrings of S.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains multiple test cases, proceeding to the End of File.\u003cbr\u003e\u003cbr\u003eThe first line of each test case has two space-separated integers M and L.\u003cbr\u003e\u003cbr\u003eThe second ine of each test case has a string S, which consists of only lowercase letters.\u003cbr\u003e\u003cbr\u003eThe length of S is not larger than 10^5, and 1 ≤ M * L ≤ the length of S."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output the answer in a single line."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 3\r\nabcabcbcaabc\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}