Problem F
Znanstvenik
In this economy, we all know how hard it is to get a job. Mirko, a recent college graduate, however, got lucky – he is now employed as a runeologist by the Language Institute of Croatia. His friend Slavko believes runeology isn’t a science and is hence angry at Mirko for believing the opposite. One foggy Christmas day, Mirko’s laptop broke. Since he isn’t great with computers, he gave it to Slavko to repair it. Slavko, feeling a little naughty, decided to mess up a particular file Mirko was working on.
This file contains a matrix of
Input
The first line of input contains two integers
In each of the next
Output
Output a single integer, the maximum number of rows which can be deleted from the top of the table so that no two columns are equal.
Sample Input 1 | Sample Output 1 |
---|---|
2 6 dobarz adatak |
0 |
Sample Input 2 | Sample Output 2 |
---|---|
3 4 alfa beta zeta |
2 |
Sample Input 3 | Sample Output 3 |
---|---|
4 6 mrvica mrvica marica mateja |
1 |