#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

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.

## Input

The first line of input will contain two integers, *N* and *M*.

The next *N* lines of input will contain *M* integers each. The *j*th integer on the *i*th line will be 1 if employee *i* can complete task *j*, and 0 otherwise.

## Output

The output should contain exactly one integer, the maximum number of tasks Peanut can assign to the employees.

## Limits

1 ≤ N, M ≤ 1000.

## Sample Input

4 4 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1

## Sample Output

3

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 100 | 16 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-8 ans.cpp -o jobs -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512