Baiatu' Bombonel has just finished setting up the Scam School curriculum. The first lesson included in the Scam School curriculum is that to be a successful scammer, you must know how not to get scammed. To teach this introductory lesson, Baiatu' Bombonel has promised to place as many students who are friends with each other in a classroom. But, being an expert scammer, Baiatu' Bombonel wants to scam them to the maximum; he wants to place as many students in a classroom who do not know each other. The IDs of each of the students are known, represented by a binary string of length each, and it is known that students and are friends only if their IDs differ by exactly one bit.
Task
Given , and the IDs of the students, determine the maximum number of students Baiatu' Bombonel can place in a classroom, under the condition that none of them know any other student in the classroom.
Input data
The first line will contain the numbers and , representing the number of students and the length of the IDs, respectively. Each of the next lines will contain a binary string of length , representing the IDs of the students.
Output data
Print the maximum number of students Baiatu' Bombonel can place in a classroom, with the condition that none of them know any other student in the classroom.
Constraints and clarifications
- ;
- For tests worth points, ;
- For other tests worth points, ;
- For other tests worth points, ;
- Each of the students have distinct IDs.
Example 1
stdin
4 4
0000
1100
0011
1111
stdout
4
Explanation
Baiatu' Bombonel can put all of the students in the same classroom, since none are friends with each other.
Example 2
stdin
4 4
0000
1100
0011
1000
stdout
3
Explanation
We can choose students , and and leave out.