Max is in a class of students who just finished writing a true or false test with questions. As the teacher, you realize Max has done horribly.
To save his grade, you want to change the answer key to maximize the lowest possible score that any student gets. What is the maximum possible lowest score?
Constraints
Input Specification
The first line of input will contain and .
The next lines will contain characters T
or F
representing the answers that were submitted in the order that the questions were given.
Sample Input 1
3 3
TTT
TTF
TFT
Sample Output 1
2
Explanation for Sample Output 1
Make the answer key TTT
. This way, the lowest score is . It can be proven that this is the maximum possible lowest score.
Sample Input 2
5 4
TFTT
TFFT
TFTF
TFFF
TFTF
Sample Output 2
2
Comments