Obada is a professional musician, however, his ears don't work that well, I guess the library has something to do with that (Stay quiet !).
Obada went to test some speakers. There are $n$ speaker sellers standing side by side. Each one will play some music on their speaker, and Obada will then decide which speaker to buy.
The problem Obada faced was that sometimes more than one seller plays music on their speaker at the same time. When that happens, he cannot decide which speaker to choose due to his condition.
Given the times at which each seller plays their music, can you find out how many speakers Obada can listen to without any problems?
The first line of input contains integers $n$ and $m$ ($1 \leq n,m \leq 1000$), where $n$ is the number of sellers and $m$ is the amount of time Obada will be listening for.
The next $n$ lines will contain a binary string (which is a string made up of $0$s and $1$s), the string will be of length m, if the $j^{th}$ bit from the $i^{th}$ string is 0 it means that the $i^{th}$ seller is not playing music on his speaker during the $j^{th}$ second (keep in mind if the bit is 1 then it means the opposite).
Output how many speakers Obada can listen to without any problems.
Input | Output |
---|---|
3 6 111000 000110 010101 Copy
|
3 Copy
|
3 3 110 011 101 Copy
|
0 Copy
|