Peanut has N employees, and M tasks that he wishes to assign to them. Each employee can only handle one task, and since not everyone is equally competent, not every employee can do every task. Help Peanut figure out what is the maximum number of tasks he can assign to the employees, if he assigns these tasks optimally.
The first line of input will contain two integers, N and M.
The next N lines of input will contain M integers each. The jth integer on the ith line will be 1 if employee i can complete task j, and 0 otherwise.
The output should contain exactly one integer, the maximum number of tasks Peanut can assign to the employees.
1 ≤ N, M ≤ 1000.
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1