Kaguya's class of students just finished its final exam, a true/false exam. Ishigami is worried that he might have failed.
To help Ishigami, Kaguya will change the answer key to maximize the lowest possible score that any student gets.
Compute the maximum possible lowest score that is attainable.
Constraints
In tests worth 1 mark, .
Input Specification
The first line contains two integers, and .
Each of the next lines contains a string of length , consisting of only T
and F
, representing the answers that were submitted
in the order that the questions were given.
Output Specification
Output the maximum possible lowest score.
Sample Input 1
5 4
TFTF
TFFF
TFTT
TFFT
TFTF
Sample Output 1
2
Sample Input 2
3 5
TFTFT
TFTFT
TFTFT
Sample Output 2
5
Comments