406944: GYM102623 C Cheat Sheet

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Cheat Sheettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

University of Shanghai for Science and Technology starts a course called Film Appreciation of Black Album recently. To be the best "Blackologist" in the university, Setsuna is actively preparing for the exam.

The 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.

Setsuna 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).

For 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.

Setsuna wants to know how many distinct keywords she can write down on the cheat sheet at most.

Uppercase and lowercase letters are considered different characters.

Input

The first line contains two integers $$$n,m(1 \leq n,m \leq 1000)$$$.

The 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.

Output

Output one integer indicating the answer.

ExamplesInput
40 5
myworld lusto KR12138 oneman233 SetsunaQAQ
Output
4
Input
7 2
^_^ ^_^
Output
1
Note

In sample $$$1$$$, it takes $$$42$$$ characters to write all the words down. So Setsuna can write down at most four.

In sample $$$2$$$, there is only one keyword.

加入题单

算法标签: