{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eUniversity of Shanghai for Science and Technology starts a course called \u003cspan class\u003d\"tex-font-style-bf\"\u003eFilm Appreciation of \u003cspan class\u003d\"tex-font-style-it\"\u003eBlack Album\u003c/span\u003e\u003c/span\u003e recently. To be the best \"Blackologist\" in the university, Setsuna is actively preparing for the exam.\u003c/p\u003e\u003cp\u003eThe examination of the course is open book; that is to say, you can only take one single-sided cheat sheet to the exam. The cheat sheet can write $$$n$$$ characters at most.\u003c/p\u003e\u003cp\u003eSetsuna has $$$m$$$ keywords that she wants to write on the cheat sheet. Her memory is not very good, so there may be some duplicate keywords. Each keyword consists of several visible characters(visible characters refer to characters with ASCII code between $$$33$$$ and $$$126$$$ inclusive).\u003c/p\u003e\u003cp\u003eFor both readability and neatness, keywords written on the cheat sheet should be separated by at least one space and must be different from each other.\u003c/p\u003e\u003cp\u003eSetsuna wants to know how many \u003cspan class\u003d\"tex-font-style-bf\"\u003edistinct\u003c/span\u003e keywords she can write down on the cheat sheet at most.\u003c/p\u003e\u003cp\u003eUppercase and lowercase letters are considered different characters.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two integers $$$n,m(1 \\leq n,m \\leq 1000)$$$.\u003c/p\u003e\u003cp\u003eThe second line contains $$$m$$$ keywords separated by exactly one space. The length of each keyword is no more than $$$100$$$. It is guaranteed that keyword only consists of visible characters.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput one integer indicating the answer.\u003c/p\u003e"}},{"title":"Examples","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\u003e40 5\nmyworld lusto KR12138 oneman233 SetsunaQAQ\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e7 2\n^_^ ^_^\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn sample $$$1$$$, it takes $$$42$$$ characters to write all the words down. So Setsuna can write down at most four.\u003c/p\u003e\u003cp\u003eIn sample $$$2$$$, there is only one keyword.\u003c/p\u003e"}}]}